summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/angle/src/compiler/translator/SymbolTable.h
diff options
context:
space:
mode:
authorAndrew Knight <andrew.knight@theqtcompany.com>2014-11-14 10:52:01 +0200
committerJani Heikkinen <jani.heikkinen@theqtcompany.com>2014-11-14 19:01:38 +0100
commitc6df5fe3ed0f2a722931be098914978cf17a666f (patch)
tree23abe340dbc427a3afd255c79316f79fef937059 /src/3rdparty/angle/src/compiler/translator/SymbolTable.h
parent32db2f425a0b85bc03d7de42d7b44337d0aa16f4 (diff)
ANGLE: Upgrade to version 1.2.30d6c255d238
The following patches have been changed: 0001-Fix-compilation-for-MSVC-2008-and-std-tuple.patch Removed because it is no longer possible to build ANGLE with MSVC2008 0002-Fix-compilation-of-ANGLE-with-mingw-tdm64-gcc-4.8.1.patch Removed because the minimum version of MinGW moved to 4.8.2 0005-Fix-build-when-SSE2-is-not-available.patch Removed because it was fixed upstream 0006-Fix-compilation-of-libGLESv2-with-older-MinGW-w64-he.patch Removed because older versions of MinGW are not supported 0007-Fix-ANGLE-build-with-Microsoft-Visual-Studio-14-CTP.patch Removed because it was fixed upstream Task-number: QTBUG-41903 Change-Id: I976d30802f7f6fee725cf9a9f1325d5e82609835 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Diffstat (limited to 'src/3rdparty/angle/src/compiler/translator/SymbolTable.h')
-rw-r--r--src/3rdparty/angle/src/compiler/translator/SymbolTable.h41
1 files changed, 33 insertions, 8 deletions
diff --git a/src/3rdparty/angle/src/compiler/translator/SymbolTable.h b/src/3rdparty/angle/src/compiler/translator/SymbolTable.h
index 6b0e0c0a03..9cd74218dc 100644
--- a/src/3rdparty/angle/src/compiler/translator/SymbolTable.h
+++ b/src/3rdparty/angle/src/compiler/translator/SymbolTable.h
@@ -31,6 +31,7 @@
//
#include <assert.h>
+#include <set>
#include "common/angleutils.h"
#include "compiler/translator/InfoSink.h"
@@ -299,19 +300,21 @@ class TSymbolTableLevel
tLevel level;
};
-enum ESymbolLevel
-{
- COMMON_BUILTINS = 0,
- ESSL1_BUILTINS = 1,
- ESSL3_BUILTINS = 2,
- LAST_BUILTIN_LEVEL = ESSL3_BUILTINS,
- GLOBAL_LEVEL = 3
-};
+// Define ESymbolLevel as int rather than an enum since level can go
+// above GLOBAL_LEVEL and cause atBuiltInLevel() to fail if the
+// compiler optimizes the >= of the last element to ==.
+typedef int ESymbolLevel;
+const int COMMON_BUILTINS = 0;
+const int ESSL1_BUILTINS = 1;
+const int ESSL3_BUILTINS = 2;
+const int LAST_BUILTIN_LEVEL = ESSL3_BUILTINS;
+const int GLOBAL_LEVEL = 3;
class TSymbolTable
{
public:
TSymbolTable()
+ : mGlobalInvariant(false)
{
// The symbol table cannot be used until push() is called, but
// the lack of an initial call to push() can be used to detect
@@ -408,6 +411,25 @@ class TSymbolTable
// for the specified TBasicType
TPrecision getDefaultPrecision(TBasicType type) const;
+ // This records invariant varyings declared through
+ // "invariant varying_name;".
+ void addInvariantVarying(const TString &originalName)
+ {
+ mInvariantVaryings.insert(originalName);
+ }
+ // If this returns false, the varying could still be invariant
+ // if it is set as invariant during the varying variable
+ // declaration - this piece of information is stored in the
+ // variable's type, not here.
+ bool isVaryingInvariant(const TString &originalName) const
+ {
+ return (mGlobalInvariant ||
+ mInvariantVaryings.count(originalName) > 0);
+ }
+
+ void setGlobalInvariant() { mGlobalInvariant = true; }
+ bool getGlobalInvariant() const { return mGlobalInvariant; }
+
static int nextUniqueId()
{
return ++uniqueIdCounter;
@@ -423,6 +445,9 @@ class TSymbolTable
typedef TMap<TBasicType, TPrecision> PrecisionStackLevel;
std::vector< PrecisionStackLevel *> precisionStack;
+ std::set<TString> mInvariantVaryings;
+ bool mGlobalInvariant;
+
static int uniqueIdCounter;
};