Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #91: If statements can be assigned to vars #106

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

davesmith00000
Copy link
Member

Relates to: #91

This code:

var i1: vec2 = null
i1 = if x0.x > x0.y then vec2(1.0, 0.0) else vec2(0.0, 1.0)

Was producing this invalid GLSL:

vec2 x0=vec2(1.0,2.0);
vec2 i1;
i1=if(x0.x>x0.y){  vec2(1.0,0.0)}else{  vec2(0.0,1.0)}
vec4(i1,0.0,1.0);

Instead of this valid GLSL:

vec2 x0=vec2(1.0,2.0);
vec2 i1;
if(x0.x>x0.y){
  i1=vec2(1.0,0.0);
}else{
  i1=vec2(0.0,1.0);
}
vec4(i1,0.0,1.0);

@davesmith00000 davesmith00000 requested a review from a team January 2, 2024 22:10
@davesmith00000 davesmith00000 self-assigned this Jan 2, 2024
@davesmith00000 davesmith00000 merged commit b105706 into main Jan 3, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant