diff options
author | Torne (Richard Coles) <torne@google.com> | 2014-10-27 14:57:29 +0000 |
---|---|---|
committer | Torne (Richard Coles) <torne@google.com> | 2014-10-27 14:57:29 +0000 |
commit | bfedac5beb763c8fb23f04230925c71708e98051 (patch) | |
tree | 8827d12dad04c9325a1c8845b043de40f2459191 /src/compiler/translator/VersionGLSL.cpp | |
parent | a913a0a5a5cf6315565b99822a18138b67caf7ed (diff) | |
parent | 2335970093f750ed465f34ae654cd84fe01c79c5 (diff) | |
download | angle-bfedac5beb763c8fb23f04230925c71708e98051.tar.gz |
Merge from Chromium at DEPS revision 614f7b807940
This commit was generated by merge_to_master.py.
Change-Id: I739e5f1f44d400e041948db14ccea8a53e136f11
Diffstat (limited to 'src/compiler/translator/VersionGLSL.cpp')
-rw-r--r-- | src/compiler/translator/VersionGLSL.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/compiler/translator/VersionGLSL.cpp b/src/compiler/translator/VersionGLSL.cpp index 8edbd009..05b111a7 100644 --- a/src/compiler/translator/VersionGLSL.cpp +++ b/src/compiler/translator/VersionGLSL.cpp @@ -26,18 +26,12 @@ static const int GLSL_VERSION_120 = 120; // GLSL 1.2 relaxed the restriction on arrays, section 5.8: "Variables that // are built-in types, entire structures or arrays... are all l-values." // -// TODO(alokp): The following two cases of invariant decalaration get lost -// during parsing - they do not get carried over to the intermediate tree. -// Handle these cases: -// 1. When a pragma is used to force all output variables to be invariant: -// - #pragma STDGL invariant(all) -// 2. When a previously decalared or built-in variable is marked invariant: -// - invariant gl_Position; -// - varying vec3 color; invariant color; -// -TVersionGLSL::TVersionGLSL(sh::GLenum type) - : mVersion(GLSL_VERSION_110) +TVersionGLSL::TVersionGLSL(sh::GLenum type, const TPragma &pragma) { + if (pragma.stdgl.invariantAll) + mVersion = GLSL_VERSION_120; + else + mVersion = GLSL_VERSION_110; } void TVersionGLSL::visitSymbol(TIntermSymbol *node) |