Repository navigation
[dxilconv] Allow patch indexing by control pointid - #9103
Open
Chris B (llvm-beanz) wants to merge 1 commit into
Open
Chris B (llvm-beanz) wants to merge 1 commit into
Chris B (llvm-beanz) wants to merge 1 commit into
Conversation
@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.
Jesse Natalie (jenatali)
approved these changes
Nov 6, 2026
Contributor
There was a problem hiding this comment.
🟢 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.outputControlPointIDand 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.