Created attachment 58905 [details]
piglit case glsl-q-interpol_negative.builtin.missmatch
Bug detailed description:
According to the spec:
“if gl_Color is redeclared with an interpolation qualifier, then gl_FrontColor and gl_BackColor (if they are written to) must also be redeclared, with the same interpolation qualifier, and vice versa”,
Our glsl compiler has no error checking when they are missing match.
This is the root cause that make following oglc cases failed.
Tests for failed linking should look like tests/shaders/link-mismatch-layout-01.c. This test should go in tests/spec/glsl-1.30/linker/interpolation-qualifier. Can you make these changes and post the test to the piglit mailing list for review?
This should be fixed by the following commit. Since this causes shaders that would have previously linked to fail, this change will *NOT* be cherry picked to any stable branches.
Author: Ian Romanick <firstname.lastname@example.org>
Date: Fri Aug 30 15:42:01 2013 -0700
glsl: Validate qualifiers on VS color outputs with FS color inputs
The vertex shader color outputs (gl_FrontColor, gl_BackColor,
gl_FrontSecondaryColor, and gl_BackSecondaryColor) don't have the same
names as the matching fragment shader color inputs (gl_Color and
gl_SecondaryColor). As a result, the qualifiers on them were not being
properly cross validated.
Full spec compliance required ir_variable::used and
ir_variable::assigned be set properly. Without the preceeding patch,
which fixes the ::clone method to copy them, this will not be the case.
Fixes all of the previously failing piglit
v2: Update callers of cross_validate_types_and_qualifiers and
cross_validate_front_and_back_color. The function signature changed in
v2 of a previous patch. Suggested by Paul.
Signed-off-by: Ian Romanick <email@example.com>
Reviewed-by: Paul Berry <firstname.lastname@example.org>
Verified it on latest mesa master and 10.2 branch.