-
Notifications
You must be signed in to change notification settings - Fork 380
Add descriptor handle support to render test framework #8814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add descriptor handle support to render test framework #8814
Conversation
2e9499e to
19290ee
Compare
Fixes shader-slang#8631 Implements automatic detection and binding of descriptor handle types (.Handle) in the slang-test framework, enabling execution tests for bindless descriptor features. Detection Strategy: Descriptor handles are lowered to uint2 (SPIRV/DX12) stored in uniform data. The detector specifically matches this pattern and excludes uint64 (device addresses) and Resource types (Metal/CUDA pointers) to avoid false positives. If getDescriptorHandle() fails, falls back to regular binding. Changes: - Add isDescriptorHandleType() detecting uint2 in UNIFORM category - Modify assignBuffer/Texture/Sampler to allocate and bind descriptor handles - Determine access mode via getResourceAccess() reflection - Fix resource lifetime by adding all resources to TestResourceContext - Add test cases requiring -render-feature bindless and -emit-spirv-directly This fixes Vulkan validation errors (VUID-vkDestroyBuffer-buffer-00922) where buffers were destroyed while still in use by command buffers when using bindless descriptors
19290ee to
b5d8cde
Compare
| // Descriptor handles in SPIRV/DX12 with bindless are lowered to uint2 | ||
| // stored in uniform data. | ||
| // | ||
| // IMPORTANT: We only check for uint2, NOT uint64! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we check uint64?
It's used when spvBindlessTextureNV is enabled. Though we might not have executable test for sampler or storage image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a mixup with device addresses which are also uint64. I'll add additional check for spvBindlessTextureNV.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kaizhangNV please have a look now.
kaizhangNV
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…8814) Fixes shader-slang#8631 Implements automatic detection and binding of descriptor handle types (.Handle) in the slang-test framework, enabling execution tests for bindless descriptor features. Changes: - Add isDescriptorHandleType() to detect .Handle types via reflection - Modify assignBuffer/Texture/Sampler to allocate and bind descriptor handles - Fix resource lifetime by adding all resources to TestResourceContext - Add test case for descriptor handle with TEST_INPUT directives This fixes Vulkan validation errors (VUID-vkDestroyBuffer-buffer-00922) where buffers were destroyed while still in use by command buffers when using bindless descriptors. The implementation uses getDescriptorHandle() on resources and setDescriptorHandle() on shader cursors to properly bind handles for Vulkan and D3D12 backends.
…8814) Fixes shader-slang#8631 Implements automatic detection and binding of descriptor handle types (.Handle) in the slang-test framework, enabling execution tests for bindless descriptor features. Changes: - Add isDescriptorHandleType() to detect .Handle types via reflection - Modify assignBuffer/Texture/Sampler to allocate and bind descriptor handles - Fix resource lifetime by adding all resources to TestResourceContext - Add test case for descriptor handle with TEST_INPUT directives This fixes Vulkan validation errors (VUID-vkDestroyBuffer-buffer-00922) where buffers were destroyed while still in use by command buffers when using bindless descriptors. The implementation uses getDescriptorHandle() on resources and setDescriptorHandle() on shader cursors to properly bind handles for Vulkan and D3D12 backends.
Fixes #8631
Implements automatic detection and binding of descriptor handle types (.Handle) in the slang-test framework, enabling execution tests for bindless descriptor features.
Changes:
This fixes Vulkan validation errors (VUID-vkDestroyBuffer-buffer-00922) where buffers were destroyed while still in use by command buffers when using bindless descriptors.
The implementation uses getDescriptorHandle() on resources and setDescriptorHandle() on shader cursors to properly bind handles for Vulkan and D3D12 backends.