-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[HLSL][TEST] Fix root signature driver test on WSL #161566
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
@llvm/pr-subscribers-hlsl @llvm/pr-subscribers-clang Author: None (joaosaffran) ChangesRunning those test in WSL seem to be generating a different file extension, Full diff: https://github.com/llvm/llvm-project/pull/161566.diff 2 Files Affected:
diff --git a/clang/test/Driver/dxc_frs.hlsl b/clang/test/Driver/dxc_frs.hlsl
index 767cab604c829..b3b685b10f01f 100644
--- a/clang/test/Driver/dxc_frs.hlsl
+++ b/clang/test/Driver/dxc_frs.hlsl
@@ -3,7 +3,7 @@
// Test to demonstrate extracting the root signature to the specified
// output file with /Frs.
-// CHECK: "{{.*}}llvm-objcopy{{(.exe)?}}" "{{.*}}.obj" "{{.*}}.dxo" "--extract-section=RTS0={{.*}}.rs.dxo"
+// CHECK: "{{.*}}llvm-objcopy{{(.exe)?}}" "{{.*}}.obj" "{{.*}}.{{(dxo|obj)}}" "--extract-section=RTS0={{.*}}.rs.dxo"
[shader("compute"), RootSignature("")]
[numthreads(1,1,1)]
diff --git a/clang/test/Driver/dxc_rootsignature_target.hlsl b/clang/test/Driver/dxc_rootsignature_target.hlsl
index 08cd1ab00089b..784523707746d 100644
--- a/clang/test/Driver/dxc_rootsignature_target.hlsl
+++ b/clang/test/Driver/dxc_rootsignature_target.hlsl
@@ -3,6 +3,6 @@
// CMDS: "{{.*}}clang{{.*}}" "-cc1"
// CMDS-SAME: "-triple" "dxilv1.1-unknown-shadermodel1.1-rootsignature"
// CMDS-SAME: "-hlsl-entry" "EntryRS"
-// CMDS: "{{.*}}llvm-objcopy{{(.exe)?}}" "{{.*}}.dxo" "--only-section=RTS0"
+// CMDS: "{{.*}}llvm-objcopy{{(.exe)?}}" "{{.*}}.{{(dxo|obj)}}" "--only-section=RTS0"
#define EntryRS "UAV(u0)"
|
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.
Great! I was having issues with this too
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.
Why is the extension different under WSL? This change might be reasonable, but I find that difference quite surprising and wonder if this is masking another bug. Can we look into the answer to that before making this change please?
from googling it seems that the dxo file type is not supported on linux? But before looking at this PR I'd never heard of this file type, so its possible I'm not reading about the correct one. |
If you specify |
After investigating a little further: If validation is disabled, that leads to 2 actions being created. Otherwise, validation is enabled, it creates 3 actions in the driver, that means that without validation only emits 1 intermediary object, meanwhile, with validation emits 2. In this section of the code https://github.com/llvm/llvm-project/blob/79d1524bde4c0253b349304e70716c3fb4f7193e/clang/lib/Driver… We handle the root signature objcopy flags, the files are handled differently if it is the last job or not. If it is not the last job, we create a temporary file, according to the job we are handling, the first 2 are object jobs, therefore they use the extension obj. If validation is enabled, since the second job is the last one, it doesn't create another temporary file, instead it uses the value associated with /Fo arg Here is the response in this 2 scenarios:
I think the fix will need another approach, other than change the test.... |
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.
Thanks for digging into this. LGTM!
Running those test with validation enabled, causes emitting an additional intermediary object, which causes the checks to fail, since it will emit 2
obj
, instead of oneobj
and onedxo
. This patch changes the test to make sure validation is disabled, making the test consistent across environments.