-
Notifications
You must be signed in to change notification settings - Fork 759
[SER] Transform RayDesc in ScalarReplHLSL for robust lowering #7435
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
Conversation
ScalarReplHLSL will refuse to faltten RayDesc if some users are incompatible. This is at odds with HLOperationLower, which always expects a specific flattened form. This implements explicit RayDesc flattening in ScalarReplHLSL to make this more reliable. One issue with RayDesc-from-cbuffer in RayQuery remains and is documented with a test. Implement ScalarReplHLSL handling for RayDesc param in HL ops: - HitObject::MakeMiss [RewriteCallArg] - HitObject::TraceRay [RewriteCallArg] - TraceRay [RewriteCallArg] - RayQuery::TraceRayInline [unchanged - flatten to RayDesc elements] In the process: - Fix copyout code in RewriteCallArg (ScalarReplHLSL) - Remove obsolete tests that expected a RayDesc alloca (where RayDesc is now SROA'd entirely) - Document RayQuery lowering bug when RayDesc is taken directly from cbuffer. Closes microsoft#7434 Unflattened RayDesc breaking HL->DXIL lowering microsoft#7434
Pipelines failing because the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just have one question.
I think we've decided to move forward with this change for the time being. I think @tex3d had a conversation with Jeff Noyle and confirmed that the pix test changes are fine. Since the alternatives would, at least, require significantly more testing, it's preferrable to take this solution while those get completed.
@@ -2687,7 +2685,7 @@ void SROA_Helper::RewriteCallArg(CallInst *CI, unsigned ArgIdx, bool bIn, | |||
Builder.SetInsertPoint(CI->getNextNode()); | |||
MemCpyInst *cpy = cast<MemCpyInst>(Builder.CreateMemCpy( | |||
userTyV, Alloca, DL.getTypeAllocSize(userTyElt), false)); | |||
RewriteMemIntrin(cpy, cpy->getRawSource()); | |||
RewriteMemIntrin(cpy, cpy->getRawDest()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change has fewer than expected, but nevertheless extant, though potentially subtle effects. What prompted it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was erroneously triggering the memcpy-undef-to-undef-optimization inRewriteMemIntrin
for the out
-copy. This change makes the in
and out
RewriteMemIntrin
calls symmetric and resolves the mis-optimization.
…yDesc is no longer flattened
We're closing this one in favor of #7440. |
ScalarReplHLSL will refuse to faltten RayDesc if some users are incompatible. This is at odds with HLOperationLower, which always expects a specific flattened form.
This implements explicit RayDesc flattening in ScalarReplHLSL to make this more reliable. One issue with RayDesc-from-cbuffer in RayQuery remains and is documented with a test.
Implement ScalarReplHLSL handling for RayDesc param in HL ops:
In the process:
Closes #7434 Unflattened RayDesc breaking HL->DXIL lowering #7434