Summary: | [glsl] C-style const arrays trigger assertion in GLSL 4.30 | ||
---|---|---|---|
Product: | Mesa | Reporter: | Ben Russell <thematrixeatsyou> |
Component: | glsl-compiler | Assignee: | Matt Turner <mattst88> |
Status: | RESOLVED MOVED | QA Contact: | Intel 3D Bugs Mailing List <intel-3d-bugs> |
Severity: | normal | ||
Priority: | medium | CC: | idr |
Version: | git | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Ben Russell
2016-06-02 02:52:00 UTC
Weird but cool. I can reproduce. I noticed that if I remove the const qualifier, it compiles. I've just returned false instead of the unreachable, and it works here. I've sent a patch to the list to address it. This should be fixed in https://cgit.freedesktop.org/mesa/mesa/commit/?id=4336196b7fc61166a36babdabdf5dd004ec9ee55 I'm not 100% sure the fix is perfect, but it works for me! Interesting. Thanks for the heads up.
Looks like the difference in behavior between 4.20 and 4.30 is due to commit 92635a84a.
Ian, it looks like adding 'const' to a declaration and initializer like
> float[] EXAMPLE1 = {1.0, 2.0, 3.0};
under #version 430 is enough to trigger the problem.
It seems strange to consider "1.0, 2.0, 3.0" to be a constant expression in the same vein as the example with "float a[2,3]".
So I think we're doing something wrong and returning false is papering over the problem.
I don't think comma separated lists of an aggregate initializer are intended treated as constant expressions.
I'm going to reopen for now.
At the same time, I don't think this needs to be tracked on the release bug. Hm... I'm trying to remember how I implemented the C-style initializers. I *thought* it used different rules in the parser, and those rules generated different productions... much like vec4(1,2,3,4) doesn't generate an ast_sequence. I'll have to dig in a bit. -- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/811. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.