[SPIR-V] SPV_EXT_descriptor_heap: Remove error diagnostic for discarded descriptor heap indexing`
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
Research direction
Start in SpirvEmitter.cpp at doCXXOperatorCallExpr and compare the discarded descriptor heap handling with the DXIL fix from #8749. Remove the diagnostic while preserving the null guard and unused-result return, then remove or repurpose sm6_6.descriptorheap.ext.discarded.error.hlsl and run the related SPIR-V tests to verify silent handling.
Written by the indexing model from the issue text.
Description
Description
Discarded descriptor heap indexing (ResourceDescriptorHeap[i]; as a bare statement) is valid HLSL. The DXIL case which used to crash was fixed in #8749, which established the intended silent no-op behavior.
The current SPIR-V path instead emits an error:
error: ResourceDescriptorHeap/SamplerDescriptorHeap indexing must be used as a resource
This is now inconsistent with DXIL and incorrect by the language.
Fix
In doCXXOperatorCallExpr (SpirvEmitter.cpp), drop the emitError when parentMap->getParent(expr) yields no parent cast. Keep the null guard and return nullptr (result is unused). Remove or repurpose sm6_6.descriptorheap.ext.discarded.error.hlsl.
References
- #8749 DXIL fix + discussion establishing correct behavior
- https://github.com/microsoft/DirectXShaderCompiler/pull/8517#discussion_r3750881342) original review discussion flagged by @llvm-beanz
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 39
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.
More from microsoft/DirectXShaderCompiler
-
bug needs-triage spirv
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
microsoft/DirectXShaderCompiler#8831 ·
-
bug needs-triage spirv
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
microsoft/DirectXShaderCompiler#8829 ·
-
bug needs-triage spirv
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/DirectXShaderCompiler#8828 ·
-
bug needs-triage spirv
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
microsoft/DirectXShaderCompiler#8827 ·
-
bug needs-triage spirv
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
microsoft/DirectXShaderCompiler#8826 ·
All issues in microsoft/DirectXShaderCompiler
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
infiniflow/infinity#3502 ·