-
Notifications
You must be signed in to change notification settings - Fork 567
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 Does Not Validate Against Empty Structs #5861
Comments
Vulkan allows empty structs (see Offset and Stride Assignment).
So I need more context about how this is failing in drivers to determine if it is truly a validation issue. |
For reference this was resolved in the internal Vulkan issue 2174. |
Interesting! So this is the minimized spirv involved. It passes spirv-val:
which came from the following slang. They removed any unbounded arrays from the underlying spirv struct, which let the LightBuffer_natural struct have zero members. They then bitcast the Something about this spirv caused nvidia to segfault in the driver and mesa to reject the pipeline, returning ERROR_UNKNOWN. I don't know if this is strictly the non-membered struct, or some other use of it, but slang ended up not emitting the struct if it has zero args, and that fixed the problem for me.
|
What looks off to me is:
SPIR-V requires that |
I added
But nvidia still segfaults and mesa returns ERROR_UNKNOWN. |
Upstream issue shader-slang/slang#5351. You can see the problematic spirv includes a
%5 = OpTypeStruct
which is an OpTypeStruct with no arguments. This causes nvidia's drivers to segfault and causes mesa to outright the reject the pipeline.As far as I can tell this is indeed invalid, so it would be nice to get validation against this, as it went unnoticed.
The text was updated successfully, but these errors were encountered: