Skip to content

[dxilconv] Allow patch indexing by control pointid - #9103

Open
Chris B (llvm-beanz) wants to merge 1 commit into
microsoft:mainfrom
llvm-beanz:dxilconv-conrolpoint-indexing
Open

Chris B (llvm-beanz) wants to merge 1 commit into
microsoft:mainfrom
llvm-beanz:dxilconv-conrolpoint-indexing

Conversation

@llvm-beanz

Copy link
Copy Markdown
Collaborator

Hans-Kristian Arntzen (@HansKristian-Work) reported a crash in dxilconv, which was root caused to a case where InputPatch objects are indexed directly by a control point id. FXC generally doesn't generate this code pattern (it instead stores to a local temporary then uses the temporary), but this pattern doesn't seem to be illegal in the DX 11 spec.

The fix here is to handle SV_OutputControlPointID as an input register to DXIL operations. This is done by adding it to
DxbcConverter::LoadOperandIndexRelative.

The test case here is hand-modified dxasm because FXC doesn't readily reproduce this.

@HansKristian-Work reported a crash in dxilconv, which was root caused
to a case where InputPatch objects are indexed directly by a control
point id. FXC generally doesn't generate this code pattern (it instead
stores to a local temporary then uses the temporary), but this pattern
doesn't seem to be illegal in the DX 11 spec.

The fix here is to handle SV_OutputControlPointID as an input register
to DXIL operations. This is done by adding it to
`DxbcConverter::LoadOperandIndexRelative`.

The test case here is hand-modified dxasm because FXC doesn't readily
reproduce this.
Copilot AI balanced review requested due to automatic review settings November 6, 2026 21:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the hull-shader control-point indexing fix.

No open issues 🎉

What changed in this PR

Fixes a DXBC-to-DXIL conversion crash when hull shaders index input control points directly with SV_OutputControlPointID.

Changes:

  • Lowers control-point ID relative indices to dx.op.outputControlPointID and reports unsupported relative-index operands as invalid DXBC.
  • Adds an assembly regression test covering direct indexing for position, render-target layer, and viewport inputs.
  • Documents the crash fix in the release notes.
File Description
projects/​dxilconv/​test/​dxbc2dxil-asm/​hull-layer-viewport.asm Adds regression coverage for direct control-point ID indexing.
projects/​dxilconv/​lib/​DxbcConverter/​DxbcConverter.cpp Supports control-point ID relative indices and rejects unsupported operands.
docs/​ReleaseNotes.md Records the hull-shader conversion crash fix.

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

3 participants