Skip to content

glsl 4.20 & 4.30: test c-style array initialization

Dmitriy Nester requested to merge GL/piglit:test/CompilationShaders into master

GLSL 430 introduces new restriction on sequence operator Section 12.43 (Sequence operator and constant expressions) says:

* "Should the following construct be allowed?
*
* float a[2,3];
*
*
*
*     The expression within the brackets uses the sequence operator
*     (',') and returns the integer 3 so the construct is declaring
*     a single-dimensional array of size 3.  In some languages, the
*     construct declares a two-dimensional array.  It would be
*     preferable to make this construct illegal to avoid confusion.
*
*     One possibility is to change the definition of the sequence
*     operator so that it does not return a constant-expression and
*     hence cannot be used to declare an array size.
*
* RESOLUTION: The result of a sequence operator is not a
* constant-expression."

When implementing this rule in mesa, a regression occurred in the brace initialization of variables. As a result, we test the correct behavior of the comma in brace initialization up to version 430 and version 430.

Issue: mesa#811 (closed)

Signed-off-by: Dmytro Nester dmytro.nester@globallogic.com

Edited by Dmitriy Nester

Merge request reports