| Summary: | GLSL ES does not allow non-constant initializers for globals | ||
|---|---|---|---|
| Product: | Mesa | Reporter: | Ian Romanick <idr> |
| Component: | glsl-compiler | Assignee: | Ian Romanick <idr> |
| Status: | RESOLVED DUPLICATE | QA Contact: | Intel 3D Bugs Mailing List <intel-3d-bugs> |
| Severity: | normal | ||
| Priority: | medium | ||
| Version: | git | ||
| Hardware: | Other | ||
| OS: | All | ||
| Whiteboard: | |||
| i915 platform: | i915 features: | ||
Looks like this is a duplicate of Bug 92304. Piglit tests which testing this are fixed now: spec/glsl-es-1.00/compiler/global-initializer/from-attribute.vert spec/glsl-es-1.00/compiler/global-initializer/from-uniform.vert spec/glsl-es-1.00/compiler/global-initializer/from-uniform.frag spec/glsl-es-1.00/compiler/global-initializer/from-global.vert spec/glsl-es-1.00/compiler/global-initializer/from-global.frag spec/glsl-es-1.00/compiler/global-initializer/from-varying.frag spec/glsl-es-3.00/compiler/global-initializer/from-uniform.vert spec/glsl-es-3.00/compiler/global-initializer/from-uniform.frag spec/glsl-es-3.00/compiler/global-initializer/from-in.vert spec/glsl-es-3.00/compiler/global-initializer/from-in.frag spec/glsl-es-3.00/compiler/global-initializer/from-global.vert spec/glsl-es-3.00/compiler/global-initializer/from-global.frag Ian, please close if this is a dup |
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.
Desktop GLSL allows things like uniform int foo; int bar = foo + 10; void main() { ... } However, the GLSL ES 3.0 and 3.1 specifications have the following language in section 4.3: "Initializers may only be used in declarations of globals with no storage qualifier or with a const qualifier. Such initializers must be a constant expression." There is anecdotal evidence that other implementations, at least on Android, enforce this restriction. At the very least, we should emit a portability warning. We probably should emit an error (in GLSL ES only) and have a driconf option to disable.