Skip to content

PIX: Preclude debug output of ray query handle from phi or select (since the value isn't really an int, it's a handle)#6309

Merged
jeffnn merged 10 commits intomicrosoft:mainfrom
jeffnn:PIX_PhiAllocateRayQuery
Feb 27, 2024
Merged

PIX: Preclude debug output of ray query handle from phi or select (since the value isn't really an int, it's a handle)#6309
jeffnn merged 10 commits intomicrosoft:mainfrom
jeffnn:PIX_PhiAllocateRayQuery

Conversation

@jeffnn
Copy link
Copy Markdown
Collaborator

@jeffnn jeffnn commented Feb 14, 2024

AllocateRayQuery returns an int, but it's not really an int: it's a handle to the query. Thus, it's not sensible for the PIX debugging instrumentation to attempt to write it out to the debug-data-UAV. The previous code did an explicit check against the type of the value to be written, but if that value is actually a phi itself, then that check would fail. So now we recursively run through the phi values looking to see if any of its antecedents are a phi, and if so, refuse to send its value to the UAV.

@jeffnn jeffnn self-assigned this Feb 14, 2024
Comment thread tools/clang/test/HLSLFileCheck/pix/TraceRayInlineDebug.hlsl
Comment thread lib/DxilPIXPasses/PixPassHelpers.cpp Outdated
@jeffnn jeffnn changed the title PIX: AllocateRayQuery PIX: Preclude debug output of ray query handle from phi or select (since the value isn't really an int, it's a handle) Feb 15, 2024
Comment thread lib/DxilPIXPasses/PixPassHelpers.cpp Outdated
@jeffnn jeffnn requested review from adam-yang and tex3d February 15, 2024 17:52
Comment thread lib/DxilPIXPasses/DxilDbgValueToDbgDeclare.cpp Outdated
Comment thread lib/DxilPIXPasses/PixPassHelpers.cpp Outdated
Comment thread lib/DxilPIXPasses/PixPassHelpers.cpp Outdated
@jeffnn jeffnn requested a review from tex3d February 21, 2024 19:22
@adam-yang
Copy link
Copy Markdown
Contributor

Do we need the SPIR-V submodule updates?

@jeffnn
Copy link
Copy Markdown
Collaborator Author

jeffnn commented Feb 26, 2024

Do we need the SPIR-V submodule updates?

Ach! That snuck in. Undone...

Copy link
Copy Markdown
Contributor

@tex3d tex3d 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 merged commit 5a31785 into microsoft:main Feb 27, 2024
@jeffnn jeffnn deleted the PIX_PhiAllocateRayQuery branch February 27, 2024 19:00
jeffnn added a commit to jeffnn/DirectXShaderCompiler that referenced this pull request Feb 27, 2024
…nce the value isn't really an int, it's a handle) (microsoft#6309)

AllocateRayQuery returns an int, but it's not really an int: it's a
handle to the query. Thus, it's not sensible for the PIX debugging
instrumentation to attempt to write it out to the debug-data-UAV. The
previous code did an explicit check against the type of the value to be
written, but if that value is actually a phi itself, then that check
would fail. So now we recursively run through the phi values looking to
see if any of its antecedents are a phi, and if so, refuse to send its
value to the UAV.

(cherry picked from commit 5a31785)
jeffnn added a commit to jeffnn/DirectXShaderCompiler that referenced this pull request Feb 27, 2024
…nce the value isn't really an int, it's a handle) (microsoft#6309)

AllocateRayQuery returns an int, but it's not really an int: it's a
handle to the query. Thus, it's not sensible for the PIX debugging
instrumentation to attempt to write it out to the debug-data-UAV. The
previous code did an explicit check against the type of the value to be
written, but if that value is actually a phi itself, then that check
would fail. So now we recursively run through the phi values looking to
see if any of its antecedents are a phi, and if so, refuse to send its
value to the UAV.

(cherry picked from commit 5a31785)
jeffnn added a commit that referenced this pull request Feb 28, 2024
Original PR:
#6309

Original commit:

5a31785

AllocateRayQuery returns an int, but it's not really an int: it's a
handle to the query. Thus, it's not sensible for the PIX debugging
instrumentation to attempt to write it out to the debug-data-UAV. The
previous code did an explicit check against the type of the value to be
written, but if that value is actually a phi itself, then that check
would fail. So now we recursively run through the phi values looking to
see if any of its antecedents are a phi, and if so, refuse to send its
value to the UAV.

(cherry picked from commit 5a31785)
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.

3 participants