-
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: Disallow stores according to VUID 06924 #5368
Conversation
If I understand the CI failures correctly, HLSL-to-SPIR-V translation by glslang and shaderc seems to result in some violations of this VUID, as HLSL allows the construct. Any suggestions what to do here? |
What does glslang do in the GLSL path when you have a local acceleration structure variable? |
GLSL allows acceleration structures (and images/samplers) only as uniforms or function parameters, and glslang diagnoses incorrect uses:
|
Does DXC handle this? I expect this is a case where glslang is missing some legalization optimizations. |
Does this check cases where there is a |
|
To progress on this, I've excluded validation of stores to objects of types |
Rebased onto latest |
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.
Just some updates to the message for now.
@s-perron Coming from a DXC perspective, should this check be gated by a pre legalization guard? |
I'm not sure. The OpTypeImage and OpTypeSampler should be guarded. We do not currently generate OpTypeSampledImage in a way that would require it, but I think that could happen in the near future. I would say yes it we should check the flag. In general, the compiler may add temporaries or the user may have local variables that are expect to get optimized away. This would be to solution to the issue with OpTypeImage and OpTypeSampler mentioned above. The output from the glslang HLSL->SPIRV should be validated with the pre-legalization option. If the checks are guarded by that option, then they should pass. |
@s-perron thanks for the suggestion, I'd much rather land the complete validation including OpTypeImage and OpTypeSampler. Is it |
Ensure that the validator rejects stores to objects of types `OpTypeImage`, `OpTypeSampler`, `OpTypeSampledImage`, `OpTypeAccelerationStructureKHR`, and arrays of these types, according to `VUID-StandaloneSpirv-OpTypeImage-06924`. Guard the check behind the before_hlsl_legalization option, as sometimes we may have temporaries or local variables that are expected to get optimized away. Fixes KhronosGroup#4796 Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com> Change-Id: Ie035c01c5f94e7bdfc16b5c6c85705f302b7bda3
I've reinstated the full checks, including OpTypeImage and OpTypeSampler, now all guarded behind before_hlsl_legalization. |
Ensure that the validator rejects stores to objects of types
OpTypeImage
,OpTypeSampler
,OpTypeSampledImage
,OpTypeAccelerationStructureKHR
, and arrays of these types, accordingto
VUID-StandaloneSpirv-OpTypeImage-06924
.Guard the check behind the before_hlsl_legalization option, as
sometimes we may have temporaries or local variables that are expected
to get optimized away.
Fixes #4796