You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[SPIR-V] Generates OpCapability RayQueryKHR when an RTAS is visible (and unused) in miss shaders #6917
Description
Certain shaders such as miss shaders don't allow further recursion when tracing rays.
A problem happens when miss and other type of shaders are mixed. A closesthit shader might access the resource, but miss shader doesn't.
In that case, emitting OpCapability RayQueryKHR is problematic and excludes the pascal generation since they don't have this capability.
I can reproduce the issue if optimizations are turned of (-O0). This is because we see the OpTypeAccelerationStructureKHR is still in the spir-v, and we opt to use it the RayQuery capability to enable it. This is a difficultly in DXC. When a feature can be enabled by multiple capabilities, we cannot know which one to use.
Hmm, that must've been it. I can't seem to reproduce it without -O0 either. Maybe a leftover binary or something that was compiled with debug. I guess I should explicitly disable it like you're showing when RayQuery isn't enabled.
EDIT: Ah, it seems it has been fixed because I added the explicit -fspv-extension=SPV_KHR_ray_tracing a couple days ago
ghost added a commit that references this issue on Nov 16, 2026
Activity
s-perron commentedon Sep 16, 2024
Nielsbishere (@Nielsbishere) We need more detailed information on how to reproduce the problem. When I try to compile your example with the latest DXC, I do not see the RayQuery capability being used: https://godbolt.org/z/Kfvn1c888.
s-perron commentedon Sep 16, 2024
I can reproduce the issue if optimizations are turned of (-O0). This is because we see the
OpTypeAccelerationStructureKHRis still in the spir-v, and we opt to use it the RayQuery capability to enable it. This is a difficultly in DXC. When a feature can be enabled by multiple capabilities, we cannot know which one to use.This can be worked around by specifically adding the allowed extensions on the command line: https://godbolt.org/z/nccj7fWGP.
Nielsbishere commentedon Sep 16, 2024
Hmm, that must've been it. I can't seem to reproduce it without -O0 either. Maybe a leftover binary or something that was compiled with debug. I guess I should explicitly disable it like you're showing when RayQuery isn't enabled.
EDIT: Ah, it seems it has been fixed because I added the explicit -fspv-extension=SPV_KHR_ray_tracing a couple days ago
Update submodules: DirectX-Headers to 61c77189, SPIRV-Headers to 5c60…
Update submodules: DirectX-Headers to 61c77189, SPIRV-Headers to 5c60…
Update submodules: DirectX-Headers to 61c77189, SPIRV-Headers to fb13…