Fix 8601 check for RayQuery user type#8610
Open
brendan-duncan wants to merge 3 commits into
Open
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Author
|
@microsoft-github-policy-service agree |
llvm-beanz
approved these changes
Jul 9, 2026
llvm-beanz
left a comment
Collaborator
There was a problem hiding this comment.
Thank you for this contribution!
I'm happy with this PR as-is, but I do (oddly) recommend removing the comments. I realize the comments do explain well the code and why it differs from the code around it, but all the code around it is also a mess of bugs that should change because string-matching type names is bad.
Co-authored-by: Chris B <beanz@abolishcrlf.org>
Co-authored-by: Chris B <beanz@abolishcrlf.org>
Author
|
Agreed with the comment removal. I was debating that myself. |
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.
Fixes #8601
Compiling to SPIR-V crashes when a user-defined struct or class is named
RayQuery(a reserved intrinsic name), e.g. a ray-tracing abstraction thatdeclares its own
RayQuerytype inside a namespace.HLSL has no rule forbidding this; the local declaration should shadow the
reserved name, and the struct should compile like any other.
Added tools/clang/test/CodeGenSPIRV/type.rayquery.user-defined-shadow.hlsl,
which reproduces the issue and checks that the shadowing struct lowers to a
normal OpTypeStruct and that no OpTypeRayQueryKHR is emitted.
Verified that the intrinsic RayQuery still lowers to OpTypeRayQueryKHR
and that existing rayquery CodeGenSPIRV tests continue to pass.