Skip to content

Fix detection of builtin UDT DXR struct types - #7452

Merged
Tex Riddell (tex3d) merged 1 commit into
microsoft:mainfrom
tex3d:fix-builtin-udt
May 15, 2025
Merged

Tex Riddell (tex3d) merged 1 commit into
microsoft:mainfrom
tex3d:fix-builtin-udt

Conversation

@tex3d

Copy link
Copy Markdown
Contributor

Built-in DXR struct types RayDesc and BuiltInTriangleIntersectionAttributes were not treated identically to other UDT types.

This caused differences in intrinsic codegen when one of these types is returned.

This change corrects this difference so these builtin structs are handled in the same way as other UDTs.

Fixes #7450.

Built-in DXR struct types RayDesc and BuiltInTriangleIntersectionAttributes
were not treated identically to other UDT types.

This caused differences in intrinsic codegen when one of these types is returned.

This change corrects this difference so these builtin structs are handled in the same way as other UDTs.

@pow2clk Gregory Roth (pow2clk) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I just have the one question. I indulged my curiosity and reverted the change to the behavior of IsHLSLCOpyableANnotatableRecord and it wasn't necessary to pass the test.

Comment thread tools/clang/lib/AST/HlslTypes.cpp Resolved
Comment thread tools/clang/lib/AST/HlslTypes.cpp Resolved
@tex3d

Copy link
Copy Markdown
Contributor Author

I just have the one question. I indulged my curiosity and reverted the change to the behavior of IsHLSLCOpyableANnotatableRecord and it wasn't necessary to pass the test.

The key change that makes a difference was in IsUserDefinedRecordType.

The other change just merges two functions that are no longer different with that change - it's no longer necessary to call IsHLSLBuiltinRayAttributeStruct from IsHLSLCopyableAnnotatableRecord. Therefore, IsHLSLCopyableAnnotatableRecord would have just called IsHLSLNumericUserDefinedType. Instead, I collapsed the two function into IsHLSLCopyableAnnotatableRecord, since that is the one called outside this file.

@pow2clk Gregory Roth (pow2clk) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the clarification!

@tex3d
Tex Riddell (tex3d) merged commit 8b406b5 into microsoft:main May 15, 2025
@github-project-automation github-project-automation Bot moved this from New to Done in HLSL Roadmap May 15, 2025
@github-project-automation github-project-automation Bot moved this from Active to Closed in HLSL Support May 15, 2025
@tex3d
Tex Riddell (tex3d) deleted the fix-builtin-udt branch May 15, 2025 00:57
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.

SER: calling hit.GetAttributes<BuiltInTriangleIntersectionAttributes>() hangs compiler

3 participants