summaryrefslogtreecommitdiff
path: root/tools/gfx/vulkan/vk-util.h
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-11-17 13:20:13 -0800
committerGitHub <noreply@github.com>2021-11-17 13:20:13 -0800
commitefebfada38cd5252da62f7618c7f95e3ab180fbd (patch)
treeca36ae2cb1e1046666103c678ab9a8e766b53efb /tools/gfx/vulkan/vk-util.h
parent763d0b5acb584a4d2eca5e02922afed7d499141e (diff)
gfx ShaderObject interface update, getTextureAllocationInfo() (#2019)
* gfx ShaderObject interface update, getTextureAllocationInfo() * Fix render-vk compiler warnings and errors. Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tools/gfx/vulkan/vk-util.h')
-rw-r--r--tools/gfx/vulkan/vk-util.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/gfx/vulkan/vk-util.h b/tools/gfx/vulkan/vk-util.h
index 450e78ebd..95f463a7a 100644
--- a/tools/gfx/vulkan/vk-util.h
+++ b/tools/gfx/vulkan/vk-util.h
@@ -45,6 +45,32 @@ struct VulkanUtil
static VkPipelineBindPoint getPipelineBindPoint(PipelineType pipelineType);
static VkImageLayout getImageLayoutFromState(ResourceState state);
+
+ static inline bool isDepthFormat(VkFormat format)
+ {
+ switch (format)
+ {
+ case VK_FORMAT_D16_UNORM:
+ case VK_FORMAT_D24_UNORM_S8_UINT:
+ case VK_FORMAT_X8_D24_UNORM_PACK32:
+ case VK_FORMAT_D32_SFLOAT:
+ case VK_FORMAT_D32_SFLOAT_S8_UINT:
+ return true;
+ }
+ return false;
+ }
+
+ static inline bool isStencilFormat(VkFormat format)
+ {
+ switch (format)
+ {
+ case VK_FORMAT_S8_UINT:
+ case VK_FORMAT_D24_UNORM_S8_UINT:
+ case VK_FORMAT_D32_SFLOAT_S8_UINT:
+ return true;
+ }
+ return false;
+ }
};
struct AccelerationStructureBuildGeometryInfoBuilder