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
Load is moved past store with optimised SPIR-V input #638
Labels
bug
Feature which should work in SPIRV-Cross does not for some reason.
Comments
HansKristian-Work
added
the
needs triage
Needs to be reproduced before it can become a different issue type.
label
Jul 9, 2018
Sounds like a simple lack of expression invalidation, but surprising it's not happening here. |
HansKristian-Work
added
bug
Feature which should work in SPIRV-Cross does not for some reason.
and removed
needs triage
Needs to be reproduced before it can become a different issue type.
labels
Jul 9, 2018
Ok, verified. This bug only seems to trigger on HLSL backend, which is a bit weird. On GLSL and MSL, the expression is properly invalidated. |
Pretty dumb oversight after all. |
rossy
added a commit
to rossy/crossc
that referenced
this issue
Jul 9, 2018
This contains a fix for an issue with UAV dependency tracking. See KhronosGroup/SPIRV-Cross#638
It works now. Thanks for the fix. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to debug this issue in mpv. It seems like a load is being migrated past a store in the HLSL output, but only when the shader is compiled with optimisations and a recent version of shaderc.
For example, this GLSL shader:
When compiled without optimisation:
Produces this SPIR-V, which produces the following HLSL when compiled with SPIRV-Cross. This seems like the correct translation of the above shader:
When compiled with optimisation:
It produces this SPIR-V, which also seems correct. The loads and stores are still in the right order. But SPIRV-Cross produces this HLSL, which moves one of the loads for the array past the store for the same array:
This probably also happens with glslValidator/spirv-opt output, but I haven't tested those.
The text was updated successfully, but these errors were encountered: