summaryrefslogtreecommitdiff
path: root/tools/gfx/vulkan/vk-util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gfx/vulkan/vk-util.cpp')
-rw-r--r--tools/gfx/vulkan/vk-util.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/tools/gfx/vulkan/vk-util.cpp b/tools/gfx/vulkan/vk-util.cpp
index 2490d48ce..4f45973f4 100644
--- a/tools/gfx/vulkan/vk-util.cpp
+++ b/tools/gfx/vulkan/vk-util.cpp
@@ -608,6 +608,46 @@ VkSamplerReductionMode VulkanUtil::translateReductionOp(TextureReductionOp op)
}
}
+CooperativeVectorComponentType VulkanUtil::translateCooperativeVectorComponentType(
+ VkComponentTypeKHR type)
+{
+ switch (type)
+ {
+ case VK_COMPONENT_TYPE_FLOAT16_KHR:
+ return CooperativeVectorComponentType::Float16;
+ case VK_COMPONENT_TYPE_FLOAT32_KHR:
+ return CooperativeVectorComponentType::Float32;
+ case VK_COMPONENT_TYPE_FLOAT64_KHR:
+ return CooperativeVectorComponentType::Float64;
+ case VK_COMPONENT_TYPE_SINT8_KHR:
+ return CooperativeVectorComponentType::SInt8;
+ case VK_COMPONENT_TYPE_SINT16_KHR:
+ return CooperativeVectorComponentType::SInt16;
+ case VK_COMPONENT_TYPE_SINT32_KHR:
+ return CooperativeVectorComponentType::SInt32;
+ case VK_COMPONENT_TYPE_SINT64_KHR:
+ return CooperativeVectorComponentType::SInt64;
+ case VK_COMPONENT_TYPE_UINT8_KHR:
+ return CooperativeVectorComponentType::UInt8;
+ case VK_COMPONENT_TYPE_UINT16_KHR:
+ return CooperativeVectorComponentType::UInt16;
+ case VK_COMPONENT_TYPE_UINT32_KHR:
+ return CooperativeVectorComponentType::UInt32;
+ case VK_COMPONENT_TYPE_UINT64_KHR:
+ return CooperativeVectorComponentType::UInt64;
+ case VK_COMPONENT_TYPE_SINT8_PACKED_NV:
+ return CooperativeVectorComponentType::SInt8Packed;
+ case VK_COMPONENT_TYPE_UINT8_PACKED_NV:
+ return CooperativeVectorComponentType::UInt8Packed;
+ case VK_COMPONENT_TYPE_FLOAT_E4M3_NV:
+ return CooperativeVectorComponentType::FloatE4M3;
+ case VK_COMPONENT_TYPE_FLOAT_E5M2_NV:
+ return CooperativeVectorComponentType::FloatE5M2;
+ default:
+ return CooperativeVectorComponentType(0);
+ }
+}
+
/* static */ Slang::Result VulkanUtil::handleFail(VkResult res)
{
if (res != VK_SUCCESS)