-
Notifications
You must be signed in to change notification settings - Fork 714
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
Fix DxilPayloadFieldAnnotation::GetPayloadFieldQualifier #6942
Conversation
You can test this locally with the following command:git-clang-format --diff 75ff50caa046a054747ae15b5c1910a4c8aa1917 073028caa634222e36f44ad6c36ef859b39c8327 -- lib/DXIL/DxilTypeSystem.cpp tools/clang/unittests/HLSL/DxilModuleTest.cpp View the diff from clang-format here.diff --git a/tools/clang/unittests/HLSL/DxilModuleTest.cpp b/tools/clang/unittests/HLSL/DxilModuleTest.cpp
index 85b412a2..98931278 100644
--- a/tools/clang/unittests/HLSL/DxilModuleTest.cpp
+++ b/tools/clang/unittests/HLSL/DxilModuleTest.cpp
@@ -574,7 +574,8 @@ TEST_F(DxilModuleTest, PayloadQualifier) {
" int b : read(caller) : write(miss);\n"
"};\n\n"
"[shader(\"miss\")]\n"
- "void Miss( inout Payload payload ) { payload.a = 4.2; payload.b = 1; }\n";
+ "void Miss( inout Payload payload ) { payload.a = 4.2; "
+ "payload.b = 1; }\n";
c.Compile(shader, L"lib_6_6", arguments, {});
|
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.
LGTM - I can't say I fully understand exactly why the simplified code is equivalent. Have you confirmed that there's any existing tests at all that are validating that it at least sometimes did what it was supposed to do?
The simplified code is not equivalent, this isn't just a simplification, it's also a bugfix. According to the DXR spec: That would map to the The old code was correct as long as the stage had either a read or write bit set, or both, it was only incorrect in that it returned |
Oops, I misspoke by "equivalent"! The nuance I was trying to get at was that presumably there are some cases where the new code would be expected to return the same results as before, and that there is some test coverage that continues to validate that. |
Yeah, the modified test had one field which verified the read, read-write, and write behaviors. Those cases continue to work. The old code took the 2 bits for read/write and constructed:
I could have simply changed the "default" temporary value to |
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.
Looks good.
Fixes #6941