Repository navigation
Require valid outputcontrolpoints on Hull shader - #6196
Natalie Chouinard (sudonatalie) merged 3 commits into
Conversation
|
Chris B (@llvm-beanz) The cases where |
|
Tex Riddell (@tex3d) Any thoughts on this? If it's too breaking of a change to error, do you have any insight into the expected behavior of outputcontrolpoints being unset or zero that could help us implement it correctly on the SPIR-V side? |
According to the documentation: "A hull shader is implemented with an HLSL function, and has the following properties: [...] The shader output is between 1 and 32 control points". https://learn.microsoft.com/en-us/windows/win32/direct3d11/direct3d-11-advanced-stages-tessellation#hull-shader-stage This change adds a check to verify that the outputcontrolpoints attribute is set on Hull shaders and has an argument in the valid range. Fixes microsoft#3733 (by making the error consistent between backends)
|
In terms of the DXIL that would be generated if 0 were allowed, it's just placed on the list of attributes for the hull entry point functions. I expect that drivers may consume this fine, but it could only mean that the domain shader wouldn't be run at all. I can't imagine why this would be a useful thing to do even in the most contrived case. |
Gregory Roth (pow2clk)
left a comment
There was a problem hiding this comment.
We discussed the need for a validation error. Turns out it exists, but it's a bit more permissive:
text:
DirectXShaderCompiler/utils/hct/hctdb.py
Line 7832 in 1a48b86
implementation:
DirectXShaderCompiler/lib/HLSL/DxilValidation.cpp
Line 5736 in 1a48b86
test:
The existence of a validation error gives me some hesitation that I didn't have this morning, but at the least if we're changing the diagnostic, we should change the validation test and text as well as add a test at the same time.
94559ae to
a39d2e1
Compare
|
Looking into the validator changes... |
You can test this locally with the following command:darker --check --diff -r 696a13a2a8d007e625c11d46f650b3a91ed72a3a..c679d6fdbdbaf936d8c0e977647f96484dcbc579 utils/hct/hctdb.pyView the diff from darker here.--- hctdb.py 2024-02-27 18:36:29.000000 +0000
+++ hctdb.py 2024-03-25 17:22:57.471712 +0000
@@ -7587,11 +7587,11 @@
"Instr.AtomicIntrinNonUAV", "Non-UAV destination to atomic intrinsic."
)
self.add_valrule_msg(
"Instr.SVConflictingLaunchMode",
"Input system values are compatible with node shader launch mode.",
- "Call to DXIL intrinsic %0 (%1) is not allowed in node shader launch type %2"
+ "Call to DXIL intrinsic %0 (%1) is not allowed in node shader launch type %2",
)
self.add_valrule("Instr.AtomicConst", "Constant destination to atomic.")
# Work-Graphs
self.add_valrule(
|
|
This change is ready for re-review! |
|
Ping Tex Riddell (@tex3d), this change is just waiting on your review. |
Gregory Roth (pow2clk)
left a comment
There was a problem hiding this comment.
Thanks for addressing the validation conflict!
|
I don't know why the formatter auto-apply is failing, but I'm going to bypass it since it's modifying a line that isn't touched in this PR anyways. |
|
I see this failing the GitHub Pages workflow, taking a look... |
This test landed after microsoft#6196 was created but before it was merged, and had an invalid attribute that is now caught and causing test failues at head.
This test landed after #6196 was created but before it was merged, and had an invalid attribute that is now caught and causing test failures at head.
) Error message was updated in #6196 which cause test fail on older validator. Since this issue is only caused by error message update, the validation itself is still the same. The compiler didn't generate anything that behaves badly with older validators. So just limit these tests to sm6.8+ to make it work on older validator.
According to the documentation: "A hull shader is implemented with an HLSL function, and has the following properties: [...] The shader output is between 1 and 32 control points".
https://learn.microsoft.com/en-us/windows/win32/direct3d11/direct3d-11-advanced-stages-tessellation#hull-shader-stage
This change adds a check to verify that the outputcontrolpoints attribute is set on Hull shaders and has an argument in the valid range.
Fixes #3733 (by making the error consistent between backends)