-
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
HLSL validation error when a Texture2D is inside a cbuffer #2754
Comments
Can you please supply the fxc command line? |
Here you can see the shader getting compiled by fxc.exe ( I don't know the exact command line ) : http://shader-playground.timjones.io/8cf11c21f20657d1000d16207292af25 Please note that I slightly updated the source code in my first post, as I had posted a too-much-stripped-down version ; sorry for the inconvenience! |
FWIW, the following shader yields identical byte code from fxc:
In other words, identical results are obtained if the cbuffer syntax is thrown away. That is the basic approach I am going to take for the solution: to effectively throw away the cbuffer syntax in this situation. I will completely handle the solution in glslang and not pass the responsibility off to the legalization passes in spirv-opt. |
A slightly different way of looking at it is to treat the opaque definitions as if they occurred outside of the cbuffer. Any non-opaque members will be treated as if they appeared in the cbuffer without the opaque members. |
What if the cbuffer specifies a register? e.g:
Currently, the
If you throw away the cbuffer syntax, it seems you are going to lose this information. |
Here's a minimal example that triggers the error.
Do you think it's legit ? This code is accepted by fxc.exe.
The text was updated successfully, but these errors were encountered: