Skip to content

PIX: Report correct bitfield values in PIX shader debugger#7557

Merged
jeffnn merged 7 commits into
microsoft:mainfrom
jeffnn:PIX_BitfieldValues
Jul 1, 2025
Merged

PIX: Report correct bitfield values in PIX shader debugger#7557
jeffnn merged 7 commits into
microsoft:mainfrom
jeffnn:PIX_BitfieldValues

Conversation

@jeffnn
Copy link
Copy Markdown
Collaborator

@jeffnn jeffnn commented Jun 19, 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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 19, 2025

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff 5aec1ec4e4d0e31a263f24458c598a3b151c0d4f 292b4ae4e36be49cdb8ffa5227e84b07890f31ed -- lib/DxilDia/DxcPixDxilStorage.cpp tools/clang/unittests/HLSL/PixDiaTest.cpp
View 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 {
  • Check this box to apply formatting changes to this branch.

Comment thread lib/DxilDia/DxcPixDxilStorage.cpp
@jeffnn jeffnn merged commit 7e0d771 into microsoft:main Jul 1, 2025
10 checks passed
@github-project-automation github-project-automation Bot moved this from New to Done in HLSL Roadmap Jul 1, 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
…7649)

cherry picked from commit
7e0d771
8a77b0c


Original PRs:

#7536
#7557

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants