Skip to content

uninitialized variables can generate illegal glsl #317

@csynth

Description

@csynth

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 #153

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions