Shader_Minifier
Shader_Minifier copied to clipboard
uninitialized variables can generate illegal glsl
Very helpful project, thank you.
The code
vec4 main() { vec4 bb; return bb; }
minimizes to
vec4 main(){return bb;}
The original is clearly bad code but according to the spec is legal with undefined results. The minimized version is not legal glsl and will not compile.
I had much more complicated (autogenerated) code where the result was well-defined despite the uninitialized variables. I don't think it worth posting that here, but could if it helped.
slightly related to https://github.com/laurentlb/Shader_Minifier/issues/153
Thanks for the report, this is clearly a bug. No need to send more code.
(if no one else sends a PR before, I expect to work on it in a couple of months)