[PIX] Fix render-state visualization passes - #8850
Open
Damyan Pepper (damyanp) wants to merge 1 commit into
Open
[PIX] Fix render-state visualization passes#8850Damyan Pepper (damyanp) wants to merge 1 commit into
Damyan Pepper (damyanp) wants to merge 1 commit into
Conversation
dx.op.storeOutput has four legal overloads: f16, f32, i16, and i32. DxilOutputColorBecomesConstant looks only for f32 and i32. A shader that writes SV_Target0 as min16float, min16int, half, or int16_t gets no constant-color instrumentation. The pass then asserts that the outputs are not mixed, and that assertion cannot tell "both types present" from "neither type recognised". The pass builds a constant buffer for the colour, but it does not give that buffer a layout ValidateCBuffer can reach. The validator therefore refuses the instrumented module. DxilReduceMSAAToSingleSample does not look through annotateHandle, and it does not accept a 16-bit texture load. Only one overload can write SV_Target0, so there is no mixed case to resolve. PIX always uploads four 32-bit components, so the shader narrows them when the output is 16 bits. The upload format does not change. Assisted-by: Copilot Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 40dc9de3-617e-4caf-ab0d-fba0a033ed93
Damyan Pepper (damyanp)
requested a review
from Austin Kinross (austinkinross)
August 27, 2026 23:43
Damyan Pepper (damyanp)
marked this pull request as ready for review
August 27, 2026 23:45
Austin Kinross (austinkinross)
approved these changes
Aug 27, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes PIX render-state visualization for 16-bit outputs, valid constant-buffer metadata, and modern MSAA handles.
Changes:
- Supports all legal
storeOutputoverloads and 16-bit narrowing. - Adds valid constant-buffer layout annotations.
- Handles SM 6.6 annotated resources and f16 MSAA loads.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
lib/DxilPIXPasses/DxilOutputColorBecomesConstant.cpp |
Adds 16-bit output support and valid buffer metadata. |
lib/DxilPIXPasses/DxilReduceMSAAToSingleSample.cpp |
Recognizes annotated handles and all load overloads. |
tools/clang/unittests/HLSL/PixTest.cpp |
Adds validation and MSAA regression tests. |
tools/clang/test/HLSLFileCheck/pix/constantcolorminprecisionMRT.hlsl |
Tests min-precision MRT output. |
tools/clang/test/HLSLFileCheck/pix/constantcolorminprecisionint.hlsl |
Tests min-precision integer output. |
tools/clang/test/HLSLFileCheck/pix/constantcolorminprecisionFromCB.hlsl |
Tests min-precision buffer narrowing. |
tools/clang/test/HLSLFileCheck/pix/constantcolorminprecision.hlsl |
Tests min-precision float literals. |
tools/clang/test/HLSLFileCheck/pix/constantcolorint16.hlsl |
Tests native 16-bit integer output. |
tools/clang/test/HLSLFileCheck/pix/constantcolorhalfMRTOnRTV1.hlsl |
Tests half output on RTV1. |
tools/clang/test/HLSLFileCheck/pix/constantcolorhalfMRT.hlsl |
Tests half output on RTV0. |
tools/clang/test/HLSLFileCheck/pix/constantcolorhalfFromCB.hlsl |
Tests native-half buffer narrowing. |
tools/clang/test/HLSLFileCheck/pix/constantcolorhalf.hlsl |
Tests native-half literal replacement. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+271
to
+273
| : Builder.CreateTrunc(ReplacementColors[ChannelIndex], | ||
| OutputValueType, | ||
| NarrowedNames[ChannelIndex]); |
|
|
||
| unsigned RangeId = | ||
| cast<ConstantInt>(CreateHandle.get_rangeId())->getLimitedValue(); | ||
| auto Resource = DM.GetSRV(RangeId); |
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.
dx.op.storeOutput has four legal overloads: f16, f32, i16, and i32. DxilOutputColorBecomesConstant looks only for f32 and i32. A shader that writes SV_Target0 as min16float, min16int, half, or int16_t gets no constant-color instrumentation. The pass then asserts that the outputs are not mixed, and that assertion cannot tell "both types present" from "neither type recognised".
The pass builds a constant buffer for the colour, but it does not give that buffer a layout ValidateCBuffer can reach. The validator therefore refuses the instrumented module.
DxilReduceMSAAToSingleSample does not look through annotateHandle, and it does not accept a 16-bit texture load.
Only one overload can write SV_Target0, so there is no mixed case to resolve. PIX always uploads four 32-bit components, so the shader narrows them when the output is 16 bits. The upload format does not change.
Assisted-by: Copilot
Stack created with GitHub Stacks CLI • Give Feedback 💬