Skip to content

FR: add --aggresive-constant-arithmetic flag #484

@wrightwriter

Description

@wrightwriter

Input:

out vec4 fragColor;
uniform float t;
void main() {
  float x = t;
  fragColor = vec4(x + 1. + 1. + 1.);
}

Output:

out vec4 f;
uniform float m;
void main(){
    f=vec4(m+1.+1.+1.);
}

Input:

out vec4 fragColor;
uniform float t;
void main() {
  float x = 999.;
  fragColor = vec4(x + 1. + 1. + 1.);
}

Output:

out vec4 f;
uniform float m;
void main(){
    f=vec4(1002);
}

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