[PIX] Fix dynamic bind-point identity and range bounds - #8848
Open
Damyan Pepper (damyanp) wants to merge 1 commit into
Open
Damyan Pepper (damyanp) wants to merge 1 commit into
Damyan Pepper (damyanp) wants to merge 1 commit into
Conversation
Damyan Pepper (damyanp)
requested a review
from Austin Kinross (austinkinross)
August 27, 2026 23:39
Austin Kinross (austinkinross)
approved these changes
Aug 27, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes PIX resource access tracking so dynamic bind points use root-signature identities and range boundaries are enforced correctly.
Changes:
- Implements strict bind-point ordering and correct register identities.
- Fixes the constant-index upper-bound check.
- Adds regression tests for both behaviors.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
lib/DxilPIXPasses/DxilShaderAccessTracking.cpp |
Corrects ordering, bounds checking, and register identity. |
tools/clang/unittests/HLSL/PixTest.cpp |
Adds PIX access-tracking regression tests. |
Suppressed comments (3)
tools/clang/unittests/HLSL/PixTest.cpp:1339
- These inferred types are all short (
CComPtr<IDxcBlob>,PassOutput, andstd::string), so usingautoconflicts with the repository's “almost never auto” convention.
auto compiled = Compile(m_dllSupport, hlsl, L"cs_6_0", {L"-Od"}, L"CSMain");
auto output =
RunShaderAccessTrackingPass(compiled, L"S0:0:2i0;U0:0:10i0;.0;0;0.");
auto text = JoinLines(output.lines);
tools/clang/unittests/HLSL/PixTest.cpp:1384
- The inferred types here are short and unambiguous, so
autoconflicts with the repository's “almost never auto” convention. Please make all three declarations explicit.
auto compiled = Compile(m_dllSupport, hlsl, L"cs_6_0", {L"-Od"}, L"CSMain");
auto output = RunShaderAccessTrackingPass(compiled, L"U0:0:1i0;.0;0;0.");
auto lines = Split(Disassemble(output.blob), '\n');
tools/clang/unittests/HLSL/PixTest.cpp:1364
- These inferred types are short and already exposed by the helper APIs. Please use explicit
CComPtr<IDxcBlob>,PassOutput, andstd::stringtypes to follow the repository's “almost never auto” convention.
auto compiled = Compile(m_dllSupport, hlsl, L"cs_6_6", {L"-Od"}, L"CSMain");
auto output = RunShaderAccessTrackingPass(compiled, L"U0:0:10i0;.0;0;0.");
auto text = JoinLines(output.lines);
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| static std::string JoinLines(std::vector<std::string> const &lines) { | ||
| std::string joined; | ||
| for (auto const &line : lines) { |
Copilot started reviewing on behalf of
Damyan Pepper (damyanp)
September 29, 2026 02:41
View session
Comment on lines
+1455
to
+1458
| auto compiled = Compile(m_dllSupport, hlsl, L"cs_6_0", {L"-Od"}, L"CSMain"); | ||
| auto output = | ||
| RunShaderAccessTrackingPass(compiled, L"S0:0:2i0;U0:0:10i0;.0;0;0."); | ||
| auto text = JoinLines(output.lines); |
Copilot started reviewing on behalf of
Damyan Pepper (damyanp)
September 29, 2026 16:28
View session
Copilot started reviewing on behalf of
Damyan Pepper (damyanp)
September 30, 2026 00:05
View session
Damyan Pepper (damyanp)
force-pushed
the
users/damyanp/pix-fixes-07
branch
from
October 1, 2026 21:59
7de0421 to
d7808b1
Compare
Make RSRegisterIdentifier a strict weak ordering, report the register a binding occupies rather than its resource-list position, and fix the off-by-one range check for constant indices. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 40dc9de3-617e-4caf-ab0d-fba0a033ed93
Damyan Pepper (damyanp)
force-pushed
the
users/damyanp/pix-fixes-07
branch
from
October 1, 2026 23:10
d7808b1 to
8598535
Compare
Comment on lines
+751
to
+752
| // RegisterID is the binding lower bound, not the resource-list ID. | ||
| ret.RegisterID = resource->GetLowerBound(); |
Comment on lines
+1480
to
+1482
| auto compiled = Compile(m_dllSupport, hlsl, L"cs_6_6", {L"-Od"}, L"CSMain"); | ||
| auto output = RunShaderAccessTrackingPass(compiled, L"U0:0:10i0;.0;0;0."); | ||
| auto text = JoinLines(output.lines); |
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.

RSRegisterIdentifier::operator< combines its three fields with &&. This is not a strict weak ordering. Two distinct ranges can compare as neither less than the other, so the map treats them as one key and gives their slot assignments to one of them. Accesses to one range are then reported against the other.
RegisterID comes from the position of the resource in the module's resource list. PIX needs the register that the binding occupies.
The range check for a constant index is off by one, so the pass accepts an index that addresses the slot after the range.
An index outside the range is still recorded at slot zero.
The meaning of RegisterID changes. A tool that resolved the old value against the module's resource list must resolve the new value against the root signature.
Assisted-by: Copilot
Stack created with GitHub Stacks CLI • Give Feedback 💬