src/compiler/translator/RemoveInvariantDeclaration.h


Log

Author Commit Date CI Message
Qiankun Miao 705a9194 2016-08-29T10:05:27 Reland "Remove invariant qualifier for input in fragment shader" This relands https://chromium-review.googlesource.com/#/c/400005/. ESSL and GLSL are not consistent on invariant matching in vertex shader and fragment shader. See the following rules: ESSL 1.00 - input and output must match ESSL 3.00 - only output, inputs cannot be declared as invariant. GLSL 1.10.59 - does not exist GLSL 1.20.8 - input and output must match GLSL 1.30.10 - input and output must match GLSL 1.40.8 - input and output must match GLSL 1.50.11 - input and output must match GLSL 3.30.6 - input and output must match GLSL 4.00.9 - input and output must match GLSL 4.10.6 - input and output must match GLSL 4.20.11 - input can omit invariant GLSL 4.30.8 - input can omit invariant GLSL 4.40.9 - input can omit invariant GLSL 4.50.5 - input can omit invariant Since GLSL 4.20, invariant qualifier description were changed to: " Only variables output from a shader (including those that are then input to a subsequent shader) can be candidates for invariance. This includes user-defined output variables and the built-in output variables. As only outputs need be declared with invariant, an output from one shader stage will still match an input of a subsequent stage without the input being declared as invariant. " It's not very clear if input in fragment can be declared as invariant. Mesa driver disallows use of input declared as invariant in fragment shader, while other drivers may allow it. This CL removes invariant declaration for input in fragment shader except AMD driver in Linux. AMD's driver obviously contradicts the spec by forcing invariance to match between vertex and fragment shaders. BUG=chromium:639760, chromium:659326 TEST=conformance/glsl/misc/shaders-with-invariance.html and conformance/glsl/bugs/invariant-does-not-leak-across-shaders.html Change-Id: I0aa9be14f0cee7a11a249c91fba27c570c52ca1b Reviewed-on: https://chromium-review.googlesource.com/404228 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Yuly Novikov c5fa0ad5 2016-10-25T21:36:54 Revert "Remove invariant qualifier for input in fragment shader" This reverts commit d842a6b2014447db0676c8a3f5a5e9ae4ce67d9a. Because of WebglConformance_conformance_glsl_bugs_invariant_does_not_leak_across_shaders failure BUG=chromium:659326 Change-Id: I0602e24f3d34ccf852cda865f673c5c7634f82a6 Reviewed-on: https://chromium-review.googlesource.com/403230 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Qiankun Miao d842a6b2 2016-08-29T10:05:27 Remove invariant qualifier for input in fragment shader ESSL and GLSL are not consistent on invariant matching in vertex shader and fragment shader. See the following rules: ESSL 1.00 - input and output must match ESSL 3.00 - only output, inputs cannot be declared as invariant. GLSL 1.10.59 - does not exist GLSL 1.20.8 - input and output must match GLSL 1.30.10 - input and output must match GLSL 1.40.8 - input and output must match GLSL 1.50.11 - input and output must match GLSL 3.30.6 - input and output must match GLSL 4.00.9 - input and output must match GLSL 4.10.6 - input and output must match GLSL 4.20.11 - input can omit invariant GLSL 4.30.8 - input can omit invariant GLSL 4.40.9 - input can omit invariant GLSL 4.50.5 - input can omit invariant Since GLSL 4.20, invariant qualifier description were changed to: " Only variables output from a shader (including those that are then input to a subsequent shader) can be candidates for invariance. This includes user-defined output variables and the built-in output variables. As only outputs need be declared with invariant, an output from one shader stage will still match an input of a subsequent stage without the input being declared as invariant. " It's not very clear if input in fragment can be declared as invariant. Mesa driver disallows use of input declared as invariant in fragment shader, while other drivers may allow it. In ESSL 3.00, inputs cannot be declared as invariant. ANGLE should follow this rule for GLSL >= 4.20. BUG=chromium:639760 Change-Id: I7f7a07401381ac970488b69752f6d50d4f19d31f Reviewed-on: https://chromium-review.googlesource.com/400005 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>