[SPIR-V] SPV_EXT_descriptor_heap: Remove error diagnostic for discarded descriptor heap indexing`

Open Beginner friendly
#8,823 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp
Domain
compilers

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

bug needs-triage spirv

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

Dominant language
C++
Stars
3.7k
Forks
900
Avg merge
2d 14h
Merged PRs (30d)
39

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.

More from microsoft/DirectXShaderCompiler

All issues in microsoft/DirectXShaderCompiler

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.