Skip to content

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

@karltechno

Description

@karltechno

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)

Metadata

Metadata

Assignees

Labels

bugBug, regression, crashcorrectnessBugs that impact shader correctness

Type

No type
No fields configured for issues without a type.

Projects

Status
Triaged

Relationships

None yet

Development

No branches or pull requests

Issue actions