-
Notifications
You must be signed in to change notification settings - Fork 555
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
spirv-val: No validation against non-uniform derivative instructions #5455
Comments
As a bit of context, we hit a bug with the use of Related: microsoft/DirectXShaderCompiler#5937 |
I'll let @alan-baker confirm, but I do not believe it is possible for spirv-val to validate this because it is a runtime condition. The validator cannot know for sure that the branch will not be quad uniform. We wrote a tool For the example above its output is:
|
@s-perron explained it well. It's ok for a linter to have false positives, but it's not for the validator. So the cases that can be caught might do more harm than good by leading to overconfidence. |
Thanks! That makes sense. |
According to https://registry.khronos.org/vulkan/specs/1.3/html/vkspec.html#shaders-derivative-operations:
All dynamic instances of explicit derivative instructions (OpDPdx*, OpDPdy*, and OpFwidth*) must be executed in control flow that is uniform within a derivative group.
The following SPIR-V violates the rule, but
spirv-val
outputs nothing:The text was updated successfully, but these errors were encountered: