Skip to content

Commit fb052bf

Browse files
authored
Support cooperative vector including Vulkan-Header (#6228)
* Support cooperative vector including Vulkan-Header Adding a Slang support for cooperative vector with vulkan-header update.
1 parent 7a8131d commit fb052bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+61
-27
lines changed

external/slang-rhi

external/vulkan

Submodule vulkan updated 57 files

tests/cooperative-vector/CoopVec/add.slang

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

tests/cooperative-vector/CoopVec/atan.slang

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

tests/cooperative-vector/CoopVec/clamp.slang

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

tests/cooperative-vector/CoopVec/comparison.slang

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

tests/cooperative-vector/CoopVec/conversion.slang

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

tests/cooperative-vector/CoopVec/copyFrom.slang

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type
1+
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -emit-spirv-directly
22
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
33
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
44

tests/cooperative-vector/CoopVec/div.slang

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

tests/cooperative-vector/CoopVec/exp.slang

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

tests/cooperative-vector/CoopVec/fill.slang

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type
1+
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -emit-spirv-directly
22
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
33
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
44

tests/cooperative-vector/CoopVec/fma.slang

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

tests/cooperative-vector/CoopVec/log.slang

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

tests/cooperative-vector/CoopVec/matrix-mul-bias-packed-mut.slang

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

tests/cooperative-vector/CoopVec/matrix-mul-bias-packed.slang

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

tests/cooperative-vector/CoopVec/max.slang

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

tests/cooperative-vector/CoopVec/min.slang

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

tests/cooperative-vector/CoopVec/mod.slang

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

tests/cooperative-vector/CoopVec/mul.slang

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

tests/cooperative-vector/CoopVec/scalar-mul.slang

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

tests/cooperative-vector/CoopVec/simple.slang

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

tests/cooperative-vector/CoopVec/step.slang

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

tests/cooperative-vector/CoopVec/sub.slang

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

tests/cooperative-vector/CoopVec/subscript.slang

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

tests/cooperative-vector/CoopVec/tanh.slang

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

tests/cooperative-vector/CoopVec/unary.slang

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

tests/cooperative-vector/CoopVec/variadic-init-cast.slang

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type
1+
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -emit-spirv-directly
22
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
33
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
44

File renamed without changes.

tests/expected-failure-github.txt

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ tests/compute/interface-shader-param.slang.5 syn (wgpu)
1515
tests/language-feature/shader-params/interface-shader-param-ordinary.slang.4 syn (wgpu)
1616
gfx-unit-test-tool/RayTracingTestAD3D12.internal
1717
gfx-unit-test-tool/RayTracingTestBD3D12.internal
18+
gfx-unit-test-tool/precompiledTargetModule2Vulkan.internal

tests/expected-failure.txt

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ tests/language-feature/saturated-cooperation/fuse.slang (vk)
55
tests/bugs/byte-address-buffer-interlocked-add-f32.slang (vk)
66
tests/ir/loop-unroll-0.slang.1 (vk)
77
tests/hlsl-intrinsic/texture/float-atomics.slang (vk)
8+
gfx-unit-test-tool/precompiledTargetModule2Vulkan.internal

tools/gfx/vulkan/vk-api.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,17 @@ Slang::Result VulkanApi::initPhysicalDevice(VkPhysicalDevice physicalDevice)
8686
vkGetPhysicalDeviceFeatures(m_physicalDevice, &m_deviceFeatures);
8787
vkGetPhysicalDeviceMemoryProperties(m_physicalDevice, &m_deviceMemoryProperties);
8888

89+
if (vkGetPhysicalDeviceCooperativeVectorPropertiesNV)
90+
{
91+
uint32_t nProps = 0;
92+
vkGetPhysicalDeviceCooperativeVectorPropertiesNV(m_physicalDevice, &nProps, nullptr);
93+
m_cooperativeVectorProperties.setCount(nProps);
94+
vkGetPhysicalDeviceCooperativeVectorPropertiesNV(
95+
m_physicalDevice,
96+
&nProps,
97+
m_cooperativeVectorProperties.getBuffer());
98+
}
99+
89100
return SLANG_OK;
90101
}
91102

tools/gfx/vulkan/vk-api.h

+7
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ namespace gfx
2222
x(vkCreateDebugReportCallbackEXT) \
2323
x(vkDestroyDebugReportCallbackEXT) \
2424
x(vkDebugReportMessageEXT) \
25+
x(vkGetPhysicalDeviceCooperativeVectorPropertiesNV) \
2526
/* */
2627

2728
#define VK_API_INSTANCE_PROCS(x) \
@@ -304,6 +305,10 @@ struct VulkanExtendedFeatureProperties
304305
VkPhysicalDeviceVulkan12Features vulkan12Features = {
305306
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES};
306307

308+
// Cooperative vector features
309+
VkPhysicalDeviceCooperativeVectorFeaturesNV cooperativeVectorFeatures = {
310+
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_VECTOR_FEATURES_NV};
311+
307312
// Ray tracing validation features
308313
VkPhysicalDeviceRayTracingValidationFeaturesNV rayTracingValidationFeatures = {
309314
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_VALIDATION_FEATURES_NV};
@@ -352,6 +357,8 @@ struct VulkanApi
352357
VkPhysicalDeviceFeatures m_deviceFeatures;
353358
VkPhysicalDeviceMemoryProperties m_deviceMemoryProperties;
354359
VulkanExtendedFeatureProperties m_extendedFeatures;
360+
361+
Slang::List<VkCooperativeVectorPropertiesNV> m_cooperativeVectorProperties;
355362
};
356363

357364
} // namespace gfx

tools/gfx/vulkan/vk-device.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,10 @@ Result DeviceImpl::initVulkanInstanceAndDevice(
511511
extendedFeatures.clockFeatures.pNext = deviceFeatures2.pNext;
512512
deviceFeatures2.pNext = &extendedFeatures.clockFeatures;
513513

514+
// cooperative vector features
515+
extendedFeatures.cooperativeVectorFeatures.pNext = deviceFeatures2.pNext;
516+
deviceFeatures2.pNext = &extendedFeatures.cooperativeVectorFeatures;
517+
514518
// Atomic Float
515519
// To detect atomic float we need
516520
// https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPhysicalDeviceShaderAtomicFloatFeaturesEXT.html
@@ -748,6 +752,16 @@ Result DeviceImpl::initVulkanInstanceAndDevice(
748752
deviceCreateInfo.pNext = &extendedFeatures.vulkan12Features;
749753
}
750754

755+
if (extendedFeatures.cooperativeVectorFeatures.cooperativeVector)
756+
{
757+
deviceExtensions.add(VK_NV_COOPERATIVE_VECTOR_EXTENSION_NAME);
758+
759+
extendedFeatures.cooperativeVectorFeatures.pNext = (void*)deviceCreateInfo.pNext;
760+
deviceCreateInfo.pNext = &extendedFeatures.cooperativeVectorFeatures;
761+
762+
m_features.add("cooperative-vector");
763+
}
764+
751765
VkPhysicalDeviceProperties2 extendedProps = {
752766
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2};
753767
VkPhysicalDeviceRayTracingPipelinePropertiesKHR rtProps = {

0 commit comments

Comments
 (0)