-
Notifications
You must be signed in to change notification settings - Fork 33
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
Declarator lists as operands of ternary operator parsed incorrectly #436
Comments
It is possible to use the workaround #version 450
out vec4 out_color;
uniform float t;
void main() {
float a, b;
t > .5
? (a = .5, b = .5)
: (a = .9, b = .1)
;
out_color = vec4(a, b, 1, 1);
} which gets minified to #version 450
out vec4 v;
uniform float f;
void main()
{
float m,N;
f>.5?
m=.5,N=.5:
(m=.9,N=.1);
v=vec4(m,N,1,1);
} (That's at the cost of one set of unneccessary |
Thanks for the reports! For the last point, that was the PR that removed the parentheses between |
The "workaround" shader is not the same as the original shader. Without the parentheses, the expression should parse as N.B. It's easier to understand and discuss outputs if renaming is disabled, since this isn't related to a renamer bug. |
The input line with The actual bug may be reproduced more simply; these both fail to parse (with different error messages): |
Hi, it's me again (sorry ._.)
The following shader should be valid (validates using glslangValidator; also compare https://www.shadertoy.com/view/lfjcWt)
But triggers a parsing error in shader_minifier:
I'm using
Shader Minifier 1.4.0
The text was updated successfully, but these errors were encountered: