Created attachment 38793 [details] [review]
new piglit case
GLSL 1.20 section 4.3.6 says:
The type and presence of the invariant qualifiers of varying variables with the same name declared in linked vertex and fragments shaders must match, otherwise the link command will fail.
GLSL 1.50 section 4.6.1 says more clearly:
For variables leaving one shader and coming into another shader, the invariant keyword has to be used in both shaders, or a link error will result.
The mesa glsl compiler fails link correctly for one vertex shader and one fragment shader.
But it links (incorrectly) successfully for two vertex shaders.
This also exists in the old glsl compiler. So I'm not marking this as release blocker.
Tested on Piketon (i965) with mesa master ca92ae2699c4aad21c0811b9a5562b9223816caf.
New piglit case attached.
(This issues also applies for centroid. I'll add a new case for it after this one gets handled.)
Ian, can you review this?
Linking should fail in this test case.
Created attachment 40347 [details] [review]
Proposed bug fix
This patch causes the Piglit test case to pass.
Review of attachment 38793 [details] [review]:
Git fails to apply this to Piglit master. I've (chad) submitted a new patch which can be successfully applied.
(In reply to comment #4)
RETRACT comment #4. It was an accidental post.
I've committed the test case from attachment id=38793 to piglit.
Fixed by Mesa commit 7528f143dfb77e3e0486006676e990964392aebf.
Change status to RESOLVED/FIXED.
Author: Chad Versace <firstname.lastname@example.org>
AuthorDate: Wed Nov 17 14:34:38 2010 -0800
Commit: Chad Versace <email@example.com>
CommitDate: Wed Dec 1 20:40:07 2010 -0800
glsl: Fix linker bug in cross_validate_globals()
Cause linking to fail if a global has mismatching invariant qualifiers.
on Dec 04, 2016 at 18:23:18.
(provided by the Example extension).