Skip to content

Commit

Permalink
Support cooperative vector including Vulkan-Header (#6228)
Browse files Browse the repository at this point in the history
* Support cooperative vector including Vulkan-Header

Adding a Slang support for cooperative vector with vulkan-header update.
  • Loading branch information
jkwak-work authored Jan 30, 2025
1 parent 7a8131d commit fb052bf
Show file tree
Hide file tree
Showing 44 changed files with 61 additions and 27 deletions.
2 changes: 1 addition & 1 deletion external/slang-rhi
2 changes: 1 addition & 1 deletion external/vulkan
Submodule vulkan updated 57 files
+1 −0 BUILD.gn
+1 −1 Makefile.release
+4 −2 include/vk_video/vulkan_video_codec_av1std.h
+1 −1 include/vk_video/vulkan_video_codec_av1std_decode.h
+143 −0 include/vk_video/vulkan_video_codec_av1std_encode.h
+1 −1 include/vk_video/vulkan_video_codec_h264std.h
+1 −1 include/vk_video/vulkan_video_codec_h264std_decode.h
+1 −1 include/vk_video/vulkan_video_codec_h264std_encode.h
+1 −1 include/vk_video/vulkan_video_codec_h265std.h
+1 −1 include/vk_video/vulkan_video_codec_h265std_decode.h
+1 −1 include/vk_video/vulkan_video_codec_h265std_encode.h
+1 −1 include/vk_video/vulkan_video_codecs_common.h
+1 −1 include/vulkan/vk_platform.h
+3,534 −123 include/vulkan/vulkan.cppm
+1 −1 include/vulkan/vulkan.h
+1,798 −769 include/vulkan/vulkan.hpp
+1 −1 include/vulkan/vulkan_android.h
+1 −1 include/vulkan/vulkan_beta.h
+2,102 −740 include/vulkan/vulkan_core.h
+1 −1 include/vulkan/vulkan_directfb.h
+905 −448 include/vulkan/vulkan_enums.hpp
+233 −52 include/vulkan/vulkan_extension_inspection.hpp
+49 −49 include/vulkan/vulkan_format_traits.hpp
+1 −1 include/vulkan/vulkan_fuchsia.h
+1,243 −150 include/vulkan/vulkan_funcs.hpp
+1 −1 include/vulkan/vulkan_ggp.h
+721 −1,209 include/vulkan/vulkan_handles.hpp
+1,477 −379 include/vulkan/vulkan_hash.hpp
+1 −1 include/vulkan/vulkan_hpp_macros.hpp
+1 −1 include/vulkan/vulkan_ios.h
+1 −1 include/vulkan/vulkan_macos.h
+42 −1 include/vulkan/vulkan_metal.h
+1,274 −142 include/vulkan/vulkan_raii.hpp
+1 −1 include/vulkan/vulkan_screen.h
+1 −1 include/vulkan/vulkan_shared.hpp
+866 −359 include/vulkan/vulkan_static_assertions.hpp
+67,096 −57,677 include/vulkan/vulkan_structs.hpp
+1,000 −438 include/vulkan/vulkan_to_string.hpp
+1 −1 include/vulkan/vulkan_vi.h
+356 −15 include/vulkan/vulkan_video.hpp
+1 −1 include/vulkan/vulkan_wayland.h
+1 −1 include/vulkan/vulkan_win32.h
+1 −1 include/vulkan/vulkan_xcb.h
+1 −1 include/vulkan/vulkan_xlib.h
+1 −1 include/vulkan/vulkan_xlib_xrandr.h
+1 −1 registry/apiconventions.py
+1 −1 registry/cgenerator.py
+1 −1 registry/generator.py
+1 −1 registry/parse_dependency.py
+5 −3 registry/reg.py
+1 −1 registry/spec_tools/conventions.py
+1 −1 registry/spec_tools/util.py
+1 −1 registry/stripAPI.py
+6,443 −3,763 registry/validusage.json
+129 −2 registry/video.xml
+2,423 −881 registry/vk.xml
+2 −2 registry/vkconventions.py
2 changes: 1 addition & 1 deletion tests/cooperative-vector/CoopVec/add.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type

Expand Down
2 changes: 1 addition & 1 deletion tests/cooperative-vector/CoopVec/atan.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type

Expand Down
2 changes: 1 addition & 1 deletion tests/cooperative-vector/CoopVec/clamp.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type

Expand Down
2 changes: 1 addition & 1 deletion tests/cooperative-vector/CoopVec/comparison.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type

Expand Down
2 changes: 1 addition & 1 deletion tests/cooperative-vector/CoopVec/conversion.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type

Expand Down
2 changes: 1 addition & 1 deletion tests/cooperative-vector/CoopVec/copyFrom.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -emit-spirv-directly
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type

Expand Down
2 changes: 1 addition & 1 deletion tests/cooperative-vector/CoopVec/div.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type

Expand Down
2 changes: 1 addition & 1 deletion tests/cooperative-vector/CoopVec/exp.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type

Expand Down
2 changes: 1 addition & 1 deletion tests/cooperative-vector/CoopVec/fill.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -emit-spirv-directly
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type

Expand Down
2 changes: 1 addition & 1 deletion tests/cooperative-vector/CoopVec/fma.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type

Expand Down
2 changes: 1 addition & 1 deletion tests/cooperative-vector/CoopVec/log.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type

Expand Down
2 changes: 1 addition & 1 deletion tests/cooperative-vector/CoopVec/max.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type

Expand Down
2 changes: 1 addition & 1 deletion tests/cooperative-vector/CoopVec/min.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type

Expand Down
2 changes: 1 addition & 1 deletion tests/cooperative-vector/CoopVec/mod.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -xslang -skip-spirv-validation
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -xslang -skip-spirv-validation -emit-spirv-directly
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu

Expand Down
2 changes: 1 addition & 1 deletion tests/cooperative-vector/CoopVec/mul.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type

Expand Down
2 changes: 1 addition & 1 deletion tests/cooperative-vector/CoopVec/scalar-mul.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type

Expand Down
2 changes: 1 addition & 1 deletion tests/cooperative-vector/CoopVec/simple.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type

Expand Down
2 changes: 1 addition & 1 deletion tests/cooperative-vector/CoopVec/step.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type

Expand Down
2 changes: 1 addition & 1 deletion tests/cooperative-vector/CoopVec/sub.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type

Expand Down
2 changes: 1 addition & 1 deletion tests/cooperative-vector/CoopVec/subscript.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation -emit-spirv-directly
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type

Expand Down
2 changes: 1 addition & 1 deletion tests/cooperative-vector/CoopVec/tanh.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type

Expand Down
2 changes: 1 addition & 1 deletion tests/cooperative-vector/CoopVec/unary.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation -xslang -skip-spirv-validation
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation -xslang -skip-spirv-validation
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type

Expand Down
2 changes: 1 addition & 1 deletion tests/cooperative-vector/CoopVec/variadic-init-cast.slang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -emit-spirv-directly
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions tests/expected-failure-github.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ tests/compute/interface-shader-param.slang.5 syn (wgpu)
tests/language-feature/shader-params/interface-shader-param-ordinary.slang.4 syn (wgpu)
gfx-unit-test-tool/RayTracingTestAD3D12.internal
gfx-unit-test-tool/RayTracingTestBD3D12.internal
gfx-unit-test-tool/precompiledTargetModule2Vulkan.internal
1 change: 1 addition & 0 deletions tests/expected-failure.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ tests/language-feature/saturated-cooperation/fuse.slang (vk)
tests/bugs/byte-address-buffer-interlocked-add-f32.slang (vk)
tests/ir/loop-unroll-0.slang.1 (vk)
tests/hlsl-intrinsic/texture/float-atomics.slang (vk)
gfx-unit-test-tool/precompiledTargetModule2Vulkan.internal
11 changes: 11 additions & 0 deletions tools/gfx/vulkan/vk-api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,17 @@ Slang::Result VulkanApi::initPhysicalDevice(VkPhysicalDevice physicalDevice)
vkGetPhysicalDeviceFeatures(m_physicalDevice, &m_deviceFeatures);
vkGetPhysicalDeviceMemoryProperties(m_physicalDevice, &m_deviceMemoryProperties);

if (vkGetPhysicalDeviceCooperativeVectorPropertiesNV)
{
uint32_t nProps = 0;
vkGetPhysicalDeviceCooperativeVectorPropertiesNV(m_physicalDevice, &nProps, nullptr);
m_cooperativeVectorProperties.setCount(nProps);
vkGetPhysicalDeviceCooperativeVectorPropertiesNV(
m_physicalDevice,
&nProps,
m_cooperativeVectorProperties.getBuffer());
}

return SLANG_OK;
}

Expand Down
7 changes: 7 additions & 0 deletions tools/gfx/vulkan/vk-api.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace gfx
x(vkCreateDebugReportCallbackEXT) \
x(vkDestroyDebugReportCallbackEXT) \
x(vkDebugReportMessageEXT) \
x(vkGetPhysicalDeviceCooperativeVectorPropertiesNV) \
/* */

#define VK_API_INSTANCE_PROCS(x) \
Expand Down Expand Up @@ -304,6 +305,10 @@ struct VulkanExtendedFeatureProperties
VkPhysicalDeviceVulkan12Features vulkan12Features = {
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES};

// Cooperative vector features
VkPhysicalDeviceCooperativeVectorFeaturesNV cooperativeVectorFeatures = {
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_VECTOR_FEATURES_NV};

// Ray tracing validation features
VkPhysicalDeviceRayTracingValidationFeaturesNV rayTracingValidationFeatures = {
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_VALIDATION_FEATURES_NV};
Expand Down Expand Up @@ -352,6 +357,8 @@ struct VulkanApi
VkPhysicalDeviceFeatures m_deviceFeatures;
VkPhysicalDeviceMemoryProperties m_deviceMemoryProperties;
VulkanExtendedFeatureProperties m_extendedFeatures;

Slang::List<VkCooperativeVectorPropertiesNV> m_cooperativeVectorProperties;
};

} // namespace gfx
14 changes: 14 additions & 0 deletions tools/gfx/vulkan/vk-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,10 @@ Result DeviceImpl::initVulkanInstanceAndDevice(
extendedFeatures.clockFeatures.pNext = deviceFeatures2.pNext;
deviceFeatures2.pNext = &extendedFeatures.clockFeatures;

// cooperative vector features
extendedFeatures.cooperativeVectorFeatures.pNext = deviceFeatures2.pNext;
deviceFeatures2.pNext = &extendedFeatures.cooperativeVectorFeatures;

// Atomic Float
// To detect atomic float we need
// https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPhysicalDeviceShaderAtomicFloatFeaturesEXT.html
Expand Down Expand Up @@ -748,6 +752,16 @@ Result DeviceImpl::initVulkanInstanceAndDevice(
deviceCreateInfo.pNext = &extendedFeatures.vulkan12Features;
}

if (extendedFeatures.cooperativeVectorFeatures.cooperativeVector)
{
deviceExtensions.add(VK_NV_COOPERATIVE_VECTOR_EXTENSION_NAME);

extendedFeatures.cooperativeVectorFeatures.pNext = (void*)deviceCreateInfo.pNext;
deviceCreateInfo.pNext = &extendedFeatures.cooperativeVectorFeatures;

m_features.add("cooperative-vector");
}

VkPhysicalDeviceProperties2 extendedProps = {
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2};
VkPhysicalDeviceRayTracingPipelinePropertiesKHR rtProps = {
Expand Down

0 comments on commit fb052bf

Please sign in to comment.