[PIX] Attribute library accesses to reaching entry points - #8849
Open
Damyan Pepper (damyanp) wants to merge 1 commit into
Open
[PIX] Attribute library accesses to reaching entry points#8849Damyan Pepper (damyanp) wants to merge 1 commit into
Damyan Pepper (damyanp) wants to merge 1 commit into
Conversation
The pass either skips a helper function in a library or gives its access the Library shader kind. Library is the kind of the module. It does not identify the pipeline stage that reaches the access. PIX cannot tell whether a record comes from a ray generation, closest-hit, or miss shader. The access record holds the instruction number in a field of 24 bits. A larger number overflows into the adjacent fields of the record. PIX receives records for helper functions, and each record carries a pipeline stage. A tool that filtered out records with the Library kind will see more data. 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:41
Damyan Pepper (damyanp)
marked this pull request as ready for review
August 27, 2026 23:42
Austin Kinross (austinkinross)
approved these changes
Aug 27, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Attributes PIX resource-access records in library helpers to their reaching shader entry-point kind and prevents instruction ordinals from corrupting adjacent record fields.
Changes:
- Resolves shader kinds through the library call graph.
- Masks instruction ordinals to 24 bits.
- Adds library-helper and bindless-access tests.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
lib/DxilPIXPasses/DxilShaderAccessTracking.cpp |
Adds shader-kind propagation and safe record encoding. |
tools/clang/test/HLSLFileCheck/pix/AccessTrackingLibHelperShaderKind.hlsl |
Verifies ray-generation encoding in a helper. |
tools/clang/unittests/HLSL/PixTest.cpp |
Adds instrumentation and validation tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+849
to
+853
| auto emplaced = | ||
| functionToShaderKind.emplace(reached, entryPointShaderKind); | ||
| if (!emplaced.second && emplaced.first->second != entryPointShaderKind) { | ||
| emplaced.first->second = ambiguousShaderKind; | ||
| } |
Comment on lines
+1335
to
+1336
| uint32_t value = | ||
| static_cast<uint32_t>(strtoul(line.c_str() + position, &end, 10)); |
Comment on lines
+557
to
+559
| constexpr uint32_t InstructionOrdinalMask = 0x00FF'FFFF; | ||
| uint32_t EncodedInstructionNumber = | ||
| (InstructionNumber & InstructionOrdinalMask) | |
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.
The pass either skips a helper function in a library or gives its access the Library shader kind. Library is the kind of the module. It does not identify the pipeline stage that reaches the access. PIX cannot tell whether a record comes from a ray generation, closest-hit, or miss shader.
The access record holds the instruction number in a field of 24 bits. A larger number overflows into the adjacent fields of the record.
PIX receives records for helper functions, and each record carries a pipeline stage. A tool that filtered out records with the Library kind will see more data.
Assisted-by: Copilot
Stack created with GitHub Stacks CLI • Give Feedback 💬