microsoft / microsoft/DirectXShaderCompiler
Potential invalid DXIL allowed to be generated
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
I have a shader that needs to be converted to spirv from dxil for Steam Deck but fails and was told by the author of dxil-spirv that the dxil generated is invalid. I have a shader below that demonstrates the issue. This generates an alloca instruction of type %dx.types.Handle (line 17) which causes the issue with the spirv conversion. It can be circumvented by using the indices directly and I also found unrolling the loop made the problematic allocas go away. However, if this is invalid dxil, should it not then be caught by DXC?
Thank you
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 with the linked Godbolt shader and inspect the generated DXIL around the %dx.types.Handle alloca, then compare DXC validation with dxil-spirv conversion. Done means determining whether DXC should reject this output or whether the generated DXIL should be valid, with the behavior reproducible from the reported shader.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers, computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 38/100