Skip to content

"integer constant overflow" errors can be triggered by minifier precomputing some float values #329

Open
@TheNuSan

Description

@TheNuSan

The following code:
float distance=100000; if (other_value < distance * distance) {....}
will be minified to something like:
if(a < 10000000000) {...}
which trigger an "integer constant overflow" opengl error at shader compile time

if I add a point to my float declaration to "force" it to be a float:
float distance=100000.; if (other_value < distance * distance) {....}
it will be minified to something like:
if(a < 1e10) {...}
and no longer be an issue

To be honest, this variable was gonna be animated later, so the issue would have probably disappeared once no longer a constant, but it took me a while to understand why it happened

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