diff options
| author | Jay Kwak <82421531+jkwak-work@users.noreply.github.com> | 2025-04-18 16:18:02 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-18 16:18:02 -0700 |
| commit | 591affaf733ec82d7b38a7bf9c4d2f49a69a2c66 (patch) | |
| tree | 89d5819114b0d40a4c927ed1185fcda0d94b5679 /tools/gfx/vulkan/vk-util.cpp | |
| parent | a597a0358f2c2b8ec1b71b7959861658a2c06ecc (diff) | |
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
Diffstat (limited to 'tools/gfx/vulkan/vk-util.cpp')
| -rw-r--r-- | tools/gfx/vulkan/vk-util.cpp | 40 |
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) |
