From 591affaf733ec82d7b38a7bf9c4d2f49a69a2c66 Mon Sep 17 00:00:00 2001 From: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Date: Fri, 18 Apr 2025 16:18:02 -0700 Subject: Check the available VK extensions before using CoopVec APIs in GFX (#6849) * Check the available VK extensions before using CoopVec APIs in GFX * Remove a redundant request for cooperative vector extension for vk --- tools/gfx/vulkan/vk-util.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'tools/gfx/vulkan/vk-util.cpp') 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) -- cgit v1.2.3