summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/angle/src/compiler/translator/VariableInfo.cpp
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/VariableInfo.cpp
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/VariableInfo.cpp')
-rw-r--r--src/3rdparty/angle/src/compiler/translator/VariableInfo.cpp81
1 files changed, 61 insertions, 20 deletions
diff --git a/src/3rdparty/angle/src/compiler/translator/VariableInfo.cpp b/src/3rdparty/angle/src/compiler/translator/VariableInfo.cpp
index f26c1566ac..d8e13788b7 100644
--- a/src/3rdparty/angle/src/compiler/translator/VariableInfo.cpp
+++ b/src/3rdparty/angle/src/compiler/translator/VariableInfo.cpp
@@ -5,6 +5,7 @@
//
#include "angle_gl.h"
+#include "compiler/translator/SymbolTable.h"
#include "compiler/translator/VariableInfo.h"
#include "compiler/translator/util.h"
#include "common/utilities.h"
@@ -131,7 +132,8 @@ CollectVariables::CollectVariables(std::vector<sh::Attribute> *attribs,
std::vector<sh::Uniform> *uniforms,
std::vector<sh::Varying> *varyings,
std::vector<sh::InterfaceBlock> *interfaceBlocks,
- ShHashFunction64 hashFunction)
+ ShHashFunction64 hashFunction,
+ const TSymbolTable &symbolTable)
: mAttribs(attribs),
mOutputVariables(outputVariables),
mUniforms(uniforms),
@@ -140,7 +142,10 @@ CollectVariables::CollectVariables(std::vector<sh::Attribute> *attribs,
mPointCoordAdded(false),
mFrontFacingAdded(false),
mFragCoordAdded(false),
- mHashFunction(hashFunction)
+ mPositionAdded(false),
+ mPointSizeAdded(false),
+ mHashFunction(hashFunction),
+ mSymbolTable(symbolTable)
{
}
@@ -200,12 +205,14 @@ void CollectVariables::visitSymbol(TIntermSymbol *symbol)
if (!mFragCoordAdded)
{
Varying info;
- info.name = "gl_FragCoord";
- info.mappedName = "gl_FragCoord";
+ const char kName[] = "gl_FragCoord";
+ info.name = kName;
+ info.mappedName = kName;
info.type = GL_FLOAT_VEC4;
info.arraySize = 0;
- info.precision = GL_MEDIUM_FLOAT; // Use mediump as it doesn't really matter.
+ info.precision = GL_MEDIUM_FLOAT; // Defined by spec.
info.staticUse = true;
+ info.isInvariant = mSymbolTable.isVaryingInvariant(kName);
mVaryings->push_back(info);
mFragCoordAdded = true;
}
@@ -214,12 +221,14 @@ void CollectVariables::visitSymbol(TIntermSymbol *symbol)
if (!mFrontFacingAdded)
{
Varying info;
- info.name = "gl_FrontFacing";
- info.mappedName = "gl_FrontFacing";
+ const char kName[] = "gl_FrontFacing";
+ info.name = kName;
+ info.mappedName = kName;
info.type = GL_BOOL;
info.arraySize = 0;
info.precision = GL_NONE;
info.staticUse = true;
+ info.isInvariant = mSymbolTable.isVaryingInvariant(kName);
mVaryings->push_back(info);
mFrontFacingAdded = true;
}
@@ -228,16 +237,50 @@ void CollectVariables::visitSymbol(TIntermSymbol *symbol)
if (!mPointCoordAdded)
{
Varying info;
- info.name = "gl_PointCoord";
- info.mappedName = "gl_PointCoord";
+ const char kName[] = "gl_PointCoord";
+ info.name = kName;
+ info.mappedName = kName;
info.type = GL_FLOAT_VEC2;
info.arraySize = 0;
- info.precision = GL_MEDIUM_FLOAT; // Use mediump as it doesn't really matter.
+ info.precision = GL_MEDIUM_FLOAT; // Defined by spec.
info.staticUse = true;
+ info.isInvariant = mSymbolTable.isVaryingInvariant(kName);
mVaryings->push_back(info);
mPointCoordAdded = true;
}
return;
+ case EvqPosition:
+ if (!mPositionAdded)
+ {
+ Varying info;
+ const char kName[] = "gl_Position";
+ info.name = kName;
+ info.mappedName = kName;
+ info.type = GL_FLOAT_VEC4;
+ info.arraySize = 0;
+ info.precision = GL_HIGH_FLOAT; // Defined by spec.
+ info.staticUse = true;
+ info.isInvariant = mSymbolTable.isVaryingInvariant(kName);
+ mVaryings->push_back(info);
+ mPositionAdded = true;
+ }
+ return;
+ case EvqPointSize:
+ if (!mPointSizeAdded)
+ {
+ Varying info;
+ const char kName[] = "gl_PointSize";
+ info.name = kName;
+ info.mappedName = kName;
+ info.type = GL_FLOAT;
+ info.arraySize = 0;
+ info.precision = GL_MEDIUM_FLOAT; // Defined by spec.
+ info.staticUse = true;
+ info.isInvariant = mSymbolTable.isVaryingInvariant(kName);
+ mVaryings->push_back(info);
+ mPointSizeAdded = true;
+ }
+ return;
default:
break;
}
@@ -251,8 +294,10 @@ void CollectVariables::visitSymbol(TIntermSymbol *symbol)
class NameHashingTraverser : public GetVariableTraverser
{
public:
- NameHashingTraverser(ShHashFunction64 hashFunction)
- : mHashFunction(hashFunction)
+ NameHashingTraverser(ShHashFunction64 hashFunction,
+ const TSymbolTable &symbolTable)
+ : GetVariableTraverser(symbolTable),
+ mHashFunction(hashFunction)
{}
private:
@@ -312,7 +357,7 @@ void CollectVariables::visitVariable(const TIntermSymbol *variable,
const TString &fullFieldName = InterfaceBlockFieldName(*blockType, field);
const TType &fieldType = *field.type();
- GetVariableTraverser traverser;
+ GetVariableTraverser traverser(mSymbolTable);
traverser.traverse(fieldType, fullFieldName, &interfaceBlock.fields);
interfaceBlock.fields.back().isRowMajorLayout = (fieldType.getLayoutQualifier().matrixPacking == EmpRowMajor);
@@ -325,7 +370,7 @@ template <typename VarT>
void CollectVariables::visitVariable(const TIntermSymbol *variable,
std::vector<VarT> *infoList) const
{
- NameHashingTraverser traverser(mHashFunction);
+ NameHashingTraverser traverser(mHashFunction, mSymbolTable);
traverser.traverse(variable->getType(), variable->getSymbol(), infoList);
}
@@ -421,9 +466,8 @@ bool CollectVariables::visitBinary(Visit, TIntermBinary *binaryNode)
return true;
}
-template <typename VarT>
-void ExpandVariables(const std::vector<VarT> &compact,
- std::vector<ShaderVariable> *expanded)
+void ExpandUniforms(const std::vector<Uniform> &compact,
+ std::vector<ShaderVariable> *expanded)
{
for (size_t variableIndex = 0; variableIndex < compact.size(); variableIndex++)
{
@@ -432,7 +476,4 @@ void ExpandVariables(const std::vector<VarT> &compact,
}
}
-template void ExpandVariables(const std::vector<Uniform> &, std::vector<ShaderVariable> *);
-template void ExpandVariables(const std::vector<Varying> &, std::vector<ShaderVariable> *);
-
}