microsoft / microsoft/DirectXShaderCompiler
DXC can sink and duplicate SetMeshOutputCounts if the inputs are computed within a scalar branch
Open
Nobody has claimed this yet.
- #8407 by @copilot-swe-agent — closed without merging
bug
correctness
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
Description
DXC can sink a call to SetMeshOutputCounts into a scalar branch if the branches are used to compute the number of vertices/indices. Anecdotally I have been able to fix it by wrapping the branch condition with WaveReadLaneFirst, despite the branch being scalar anyway.
Steps to Reproduce
See https://godbolt.org/z/oca77vqGh
Actual Behavior
DXC validation fails after SetMeshOutputCounts is duplicated in resulting DXIL:
<source>:32:5: error: SetMeshOUtputCounts cannot be called multiple times.
Environment
- DXC version: DXC 1.8.2505 on compiler explorer
- Host Operating System Observed on: windows and linux (via compiler explorer)
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.
Assessment
This issue has not been assessed yet.