OSDN Git Service

glsl: Fix invariant matching in GLSL 4.30 and GLSL ES 1.00.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 11 Aug 2016 13:12:53 +0000 (06:12 -0700)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 1 Sep 2016 10:39:42 +0000 (11:39 +0100)
commitbc40bc552780012b4563506fda7f17615fd019ba
tree00cde9483540c7cf70b05fced2308e76f6126bce
parent0c25b3e4b00d6418c0d9c40071debe7727c1b512
glsl: Fix invariant matching in GLSL 4.30 and GLSL ES 1.00.

Old languages (GLSL <= 4.20 and GLSL ES 1.00) require "invariant"
to be specified on both inputs and outputs, and match when linking.

New languages only allow outputs to be qualified as "invariant"
and remove the "invariant must match" restriction when linking
varyings (because no input can have that qualifier).

Commit 426a50e2089b12d33f5c075aa5622f64076914a3 introduced the new
behavior for ES 3.00.  It also removed the "must match" restriction
for ES 1.00 shaders, which I believe is incorrect.  This patch adds
that back, as well as making 4.30+ follow the new rules.

Thanks to Qiankun Miao for noticing this discrepancy.

Fixes a WebGL 2.0 conformance test when run in Chromium:
https://www.khronos.org/registry/webgl/sdk/tests/deqp/data/gles3/shaders/qualification_order.html?webglVersion=2

Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96971
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
(cherry picked from commit f9f462936ad903f93829404ce99a2580ea21b725)
src/compiler/glsl/glsl_parser.yy
src/compiler/glsl/link_varyings.cpp