summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/gfx/vulkan/render-vk.cpp89
-rw-r--r--tools/gfx/vulkan/render-vk.h48
-rw-r--r--tools/gfx/vulkan/vk-device.cpp14
3 files changed, 10 insertions, 141 deletions
diff --git a/tools/gfx/vulkan/render-vk.cpp b/tools/gfx/vulkan/render-vk.cpp
deleted file mode 100644
index 83b9e979b..000000000
--- a/tools/gfx/vulkan/render-vk.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-// render-vk.cpp
-#include "render-vk.h"
-#include "core/slang-blob.h"
-#include "vk-util.h"
-
-// Vulkan has a different coordinate system to ogl
-// http://anki3d.org/vulkan-coordinate-system/
-#ifndef ENABLE_VALIDATION_LAYER
-# if _DEBUG
-# define ENABLE_VALIDATION_LAYER 1
-# else
-# define ENABLE_VALIDATION_LAYER 0
-# endif
-#endif
-
-#ifdef _MSC_VER
-# include <stddef.h>
-# pragma warning(disable : 4996)
-# if (_MSC_VER < 1900)
-# define snprintf sprintf_s
-# endif
-#endif
-
-#if SLANG_WINDOWS_FAMILY
-# include <dxgi1_2.h>
-#endif
-
-namespace gfx
-{
-using namespace Slang;
-
-namespace vk
-{
-namespace
-{
-
-} // namespace
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-} // namespace vk
-
-
-
-} // namespace gfx
diff --git a/tools/gfx/vulkan/render-vk.h b/tools/gfx/vulkan/render-vk.h
deleted file mode 100644
index cd4a79b07..000000000
--- a/tools/gfx/vulkan/render-vk.h
+++ /dev/null
@@ -1,48 +0,0 @@
-// render-vk.h
-#pragma once
-
-#include "../command-encoder-com-forward.h"
-#include "../mutable-shader-object.h"
-#include "../renderer-shared.h"
-#include "../transient-resource-heap-base.h"
-#include "core/slang-chunked-list.h"
-#include "vk-api.h"
-#include "vk-descriptor-allocator.h"
-#include "vk-device-queue.h"
-
-namespace gfx
-{
-namespace vk
-{
-using namespace Slang;
-
-enum
-{
-
- kMaxPushConstantSize = 256,
- kMaxDescriptorSets = 8,
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-} // namespace vk
-} // namespace gfx
diff --git a/tools/gfx/vulkan/vk-device.cpp b/tools/gfx/vulkan/vk-device.cpp
index 546f581b4..a5e990232 100644
--- a/tools/gfx/vulkan/vk-device.cpp
+++ b/tools/gfx/vulkan/vk-device.cpp
@@ -1589,7 +1589,7 @@ Result DeviceImpl::createTextureView(
return SLANG_OK;
}
- bool isArray = desc.subresourceRange.layerCount > 1;
+ bool isArray = resourceImpl->getDesc()->arraySize > 1;
VkImageViewCreateInfo createInfo = {};
createInfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;
createInfo.flags = 0;
@@ -1625,9 +1625,15 @@ Result DeviceImpl::createTextureView(
createInfo.subresourceRange.baseArrayLayer = desc.subresourceRange.baseArrayLayer;
createInfo.subresourceRange.baseMipLevel = desc.subresourceRange.mipLevel;
- createInfo.subresourceRange.layerCount = desc.subresourceRange.layerCount == 0
- ? VK_REMAINING_ARRAY_LAYERS
- : desc.subresourceRange.layerCount;
+ createInfo.subresourceRange.layerCount = desc.subresourceRange.layerCount;
+ if (createInfo.subresourceRange.layerCount == 0)
+ {
+ createInfo.subresourceRange.layerCount = isArray ? VK_REMAINING_ARRAY_LAYERS : 1;
+ if (createInfo.viewType == VK_IMAGE_VIEW_TYPE_CUBE)
+ {
+ createInfo.subresourceRange.layerCount = 6;
+ }
+ }
createInfo.subresourceRange.levelCount = desc.subresourceRange.mipLevelCount == 0
? VK_REMAINING_MIP_LEVELS
: desc.subresourceRange.mipLevelCount;