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

Open
#8,830 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-triage spirv
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.