microsoft / microsoft/DirectXShaderCompiler
[SPIR-V] SPV_EXT_descriptor_heap SPV_NV_ray_tracing accepted for AS heap stride but RayTracingNV capability not emitted for non-RT shaders
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
Description
When -fspv-extension=SPV_NV_ray_tracing is supplied, the stride pre-detection logic in SpirvEmitter.cpp marks the heap stride as acceleration-structure-aware and emits OpTypeAccelerationStructureKHR + OpConstantSizeOfEXT. However, CapabilityVisitor only adds the RayTracingNV capability when an RT instruction or execution model is visited. A compute shader compiled with SPV_NV_ray_tracing for heap AS access therefore emits the acceleration structure type without its enabling capability, producing invalid SPIR-V.
Fix
When the NV path is taken for heap stride computation, explicitly add the RayTracingNV capability, or exclude SPV_NV_ray_tracing from the set of extensions that trigger AS stride widening and document the omission.
References
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in SpirvEmitter.cpp and trace the stride pre-detection path for SPV_NV_ray_tracing, then inspect CapabilityVisitor to see how RayTracingNV is emitted. Verify the compute-shader heap access case described in the issue and confirm that the resulting SPIR-V has valid capability coverage, or that the extension is excluded and the omission is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100