microsoft / microsoft/DirectXShaderCompiler

DXC can sink and duplicate SetMeshOutputCounts if the inputs are computed within a scalar branch

Open
#8,104 4 comments 0 reactions 1 assignee View on GitHub

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

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.