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

Add test of comma operator in constant-expression context. #3411

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kenrussell
Copy link
Member

In GLSL 3.00 section 12.43 "Sequence operator and constant
expressions" this is disallowed.

Associated with http://crbug.com/1324747 .

In GLSL 3.00 section 12.43 "Sequence operator and constant
expressions" this is disallowed.

Associated with http://crbug.com/1324747 .
@johnstiles-google
Copy link

Adding a test SGTM, thanks for writing the PR! Few tweaks I would suggest:

The comment "// <-- no error" is deceptive and should probably be removed. I originally put this comment here to pinpoint the place where an error ought to occur, but wasn't occurring.

The rest of the shader code after that line is just boilerplate from my shader-building tool and doesn't add value to the test.

@davychxn
Copy link

davychxn commented Jan 13, 2023

The rest of the shader code after that line is just boilerplate from my shader-building tool and doesn't add value to the test.

So, maybe this just good?

void main() {
    // Expecting compiling errors here
    int array[(2, 3)];
    out_color = vec4(1.0);
}

@johnstiles-google
Copy link

Yes, that looks better.

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.

3 participants