Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIX: split vector alloca writes to enable debug instrumentation #6990

Merged
merged 11 commits into from
Dec 4, 2024

Conversation

jeffnn
Copy link
Collaborator

@jeffnn jeffnn commented Oct 29, 2024

Bit of background: PIX's debug passes add new allocas, stores to which tie debug info to DXIL Values.
In the case of a preexisting alloca, PIX will still add its debug writes, but the codegen may have emitted vector-valued stores. Concretely, this happens for the ray payload and RayDesc structs in DXR. Those vector-values stores were being treated incorrectly, resulting in missing values in the PIX shader debugger.

This change splits vector-valued stores to such allocas into extractelement/scalar-stores, which enables the rest of the PIX instrumentation to function as expected.

(Worth noting that this change only applies to the PIX shader debugging pass.)

@jeffnn jeffnn self-assigned this Oct 29, 2024
@jeffnn jeffnn requested a review from a team as a code owner October 29, 2024 17:42
@damyanp damyanp requested a review from adam-yang November 19, 2024 17:18
Copy link
Member

@damyanp damyanp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but we should get a review from someone more familiar with all of this. @adam-yang perhaps?

Is there a reason that the testing for this isn't filecheck based?

Copy link
Contributor

@adam-yang adam-yang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only big one is the leak.

@jeffnn
Copy link
Collaborator Author

jeffnn commented Nov 20, 2024

LGTM, but we should get a review from someone more familiar with all of this. @adam-yang perhaps?

Is there a reason that the testing for this isn't filecheck based?

Yes: you can't get the textual pass "printf" output via filecheck.

@jeffnn jeffnn requested a review from adam-yang November 20, 2024 17:52
Copy link
Contributor

@adam-yang adam-yang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jeffnn jeffnn requested a review from damyanp November 21, 2024 16:48
@damyanp
Copy link
Member

damyanp commented Dec 4, 2024

Still LGTM - changing my review into an approval!

@jeffnn jeffnn merged commit a03a77f into microsoft:main Dec 4, 2024
12 checks passed
@jeffnn jeffnn deleted the PIX_VectorAllocaStores branch December 4, 2024 20:27
jeffnn added a commit to jeffnn/DirectXShaderCompiler that referenced this pull request Dec 5, 2024
…osoft#6990)

Bit of background: PIX's debug passes add new allocas, stores to which
tie debug info to DXIL Values.
In the case of a preexisting alloca, PIX will still add its debug
writes, but the codegen may have emitted vector-valued stores.
Concretely, this happens for the ray payload and RayDesc structs in DXR.
Those vector-values stores were being treated incorrectly, resulting in
missing values in the PIX shader debugger.

This change splits vector-valued stores to such allocas into
extractelement/scalar-stores, which enables the rest of the PIX
instrumentation to function as expected.

(Worth noting that this change only applies to the PIX shader debugging
pass.)

(cherry picked from commit a03a77f)
jeffnn added a commit that referenced this pull request Dec 5, 2024
…ion status) (#7027)

Original PRs:
#6990
(cherry picked from commit
a03a77f)

#7010
(cherry picked from commit
848b7c4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants