-
Notifications
You must be signed in to change notification settings - Fork 836
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
Invalid SPIR-V produced when gl_ObjectToWorldEXT and gl_ObjectToWorld3x4EXT used in the same shader #2921
Comments
Incidentally, |
@dgkoch This code appears to be yours. Can you please fix? |
@greg-lunarg I contributed the code, but it was written by someone else, who is likely not available at this point. |
@greg-lunarg If you haven't started on this yet: we (Arm) will try to write a patch at some point. |
OK. I will wait for your patch. |
…osGroup#2921) Fixes an issue where invalid SPIR-V was generated when gl_ObjectToWorldEXT and gl_ObjectToWorld3x4EXT, or gl_WorldToObjectEXT and gl_WorldToObject3x4EXT, were used in the same shader. The SPIR-V specification requires that there be at most one OpVariable decorated with a given BuiltIn value. Change-Id: I94dc9ee3f7adf1acb29873d68056fdb2caf8cac3
…osGroup#2921) Fixes an issue where invalid SPIR-V was generated when gl_ObjectToWorldEXT and gl_ObjectToWorld3x4EXT, or gl_WorldToObjectEXT and gl_WorldToObject3x4EXT, were used in the same shader. The SPIR-V specification requires that there be at most one OpVariable decorated with a given BuiltIn value.
Here is the patch: #2955 |
Avoid duplicate BuiltIn variables for ray tracing matrices (fix #2921)
Consider the following intersection shader:
There is no "3x4" version of the SPIR-V built-in, so glslang maps both of these built-ins to
ObjectToWorldKHR
and inserts a transpose.However, if you use both of these in the same shader, you will get two variables decorated with the same
BuiltIn
:This is not permitted by the SPIR-V specification:
The same issue exists for the pair of
gl_WorldToObjectEXT
andgl_WorldToObject3x4EXT
.This issue is similar to #2910 but is not as easy to fix because the built-ins are not perfect aliases.
The text was updated successfully, but these errors were encountered: