-
Notifications
You must be signed in to change notification settings - Fork 691
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
Ability to access default values for parameters in a constant buffer #2380
Comments
HLSL should warn/error on this because the initializers are ignored. You shouldn't see their values anywhere in the generated DXIL code, or SPIR-V code. I filed this bug on the issue: #2384. If you are able to observe the initializer values being taken into account anywhere, that would be bug-worthy. Otherwise, I think there is nothing for SPIR-V to do here, just a missing warning we need to add to the common semantic validation. |
Yup! Thanks @MrTrillian |
@MrTrillian are you saying default values are always ignored in DXC? Please see this example code :
It's extremely useful to be able to define default values in hlsl so I can just extract them from reflection api. |
In HLSL I can do this:
But when converting to Spir-V the default value information is lost.
Feature Request:
Please make this work for SPIR-V too, because now I have to compile the shader 2 times, non-Spir-V to get default values and Spir-V to generate GLSL code.
Thank you
Also posted here:
KhronosGroup/SPIRV-Headers#125
KhronosGroup/SPIRV-Cross#1094
The text was updated successfully, but these errors were encountered: