You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Desktop GLSL allows initializing unbuffered uniform variables to a constant value directly in shader code.
As far as I can tell (and please let me know if I'm wrong), glslang's reflection interface doesn't expose those values anywhere, but it does internally detect them because it correctly errors when a uniform is initialized to a non-constant value on desktop GLSL and when a uniform is initialized to a constant value in GLSL ES.
I'd really like a way to obtain their values (and whether they've been explicitly initialized), through glslang's APIs. I have an existing tool with desktop GLSL shaders written for it by a large number of people, and I want to use glslang's SPIRV output capabilities combined with SPIRV-Cross to translate those shaders to other graphics APIs, but not every shader will be able to be fully ported without having a way to identify those values, and I wouldn't be able to tell users when their shader wouldn't work either, unless I restrict myself to GLSL ES.
The text was updated successfully, but these errors were encountered:
I now see that #1588 exists - if after applying that change I can parse the constant values from spirv generated with glslang, I think that will be sufficient for my purposes.
Desktop GLSL allows initializing unbuffered uniform variables to a constant value directly in shader code.
As far as I can tell (and please let me know if I'm wrong), glslang's reflection interface doesn't expose those values anywhere, but it does internally detect them because it correctly errors when a uniform is initialized to a non-constant value on desktop GLSL and when a uniform is initialized to a constant value in GLSL ES.
I'd really like a way to obtain their values (and whether they've been explicitly initialized), through glslang's APIs. I have an existing tool with desktop GLSL shaders written for it by a large number of people, and I want to use glslang's SPIRV output capabilities combined with SPIRV-Cross to translate those shaders to other graphics APIs, but not every shader will be able to be fully ported without having a way to identify those values, and I wouldn't be able to tell users when their shader wouldn't work either, unless I restrict myself to GLSL ES.
The text was updated successfully, but these errors were encountered: