PIX: Report correct bitfield values in PIX shader debugger#7557
Merged
Conversation
Contributor
You can test this locally with the following command:git-clang-format --diff 5aec1ec4e4d0e31a263f24458c598a3b151c0d4f 292b4ae4e36be49cdb8ffa5227e84b07890f31ed -- lib/DxilDia/DxcPixDxilStorage.cpp tools/clang/unittests/HLSL/PixDiaTest.cppView the diff from clang-format here.diff --git a/tools/clang/unittests/HLSL/PixDiaTest.cpp b/tools/clang/unittests/HLSL/PixDiaTest.cpp
index 21162226..d36e7627 100644
--- a/tools/clang/unittests/HLSL/PixDiaTest.cpp
+++ b/tools/clang/unittests/HLSL/PixDiaTest.cpp
@@ -2789,7 +2789,7 @@ public:
DxcIncludeHandlerForInjectedSourcesForPix(
PixDiaTest *pixTest,
std::vector<std::pair<std::wstring, std::string>> files)
- : m_dwRef(0), m_files(files), m_pixTest(pixTest) {};
+ : m_dwRef(0), m_files(files), m_pixTest(pixTest){};
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid,
void **ppvObject) override {
|
adam-yang
reviewed
Jun 20, 2025
adam-yang
approved these changes
Jun 20, 2025
adam-yang
approved these changes
Jun 26, 2025
jeffnn
added a commit
that referenced
this pull request
Jul 17, 2025
The key change here is the & in DxcDxilPixStorage.cpp. The generated DXIL packs the bitfields into their 32- or 64-bit-typed Values as expected, but this code, when trying to figure out which Value a bitfield lives in, was looking up the unpacked bit offset, so only fields within the zeroth underlying Value were being reported correctly. With this change, PIX reports correct bitfield values wherever they live, including within deeply nested structs. Unfortunately, the tests had to be in C++ because file-check obv. doesn't run the APIs that PIX uses to read debug data. --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> (cherry picked from commit 7e0d771)
jeffnn
added a commit
that referenced
this pull request
Jul 17, 2025
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 key change here is the & in DxcDxilPixStorage.cpp. The generated DXIL packs the bitfields into their 32- or 64-bit-typed Values as expected, but this code, when trying to figure out which Value a bitfield lives in, was looking up the unpacked bit offset, so only fields within the zeroth underlying Value were being reported correctly.
With this change, PIX reports correct bitfield values wherever they live, including within deeply nested structs.
Unfortunately, the tests had to be in C++ because file-check obv. doesn't run the APIs that PIX uses to read debug data.