diff options
Diffstat (limited to 'src/3rdparty/angle/src/compiler/VariableInfo.cpp')
-rw-r--r-- | src/3rdparty/angle/src/compiler/VariableInfo.cpp | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/src/3rdparty/angle/src/compiler/VariableInfo.cpp b/src/3rdparty/angle/src/compiler/VariableInfo.cpp index 3ff283627b..eb6bea9b0f 100644 --- a/src/3rdparty/angle/src/compiler/VariableInfo.cpp +++ b/src/3rdparty/angle/src/compiler/VariableInfo.cpp @@ -77,23 +77,25 @@ static void getBuiltInVariableInfo(const TType& type, static void getUserDefinedVariableInfo(const TType& type, const TString& name, const TString& mappedName, - TVariableInfoList& infoList); + TVariableInfoList& infoList, + ShHashFunction64 hashFunction); // Returns info for an attribute or uniform. static void getVariableInfo(const TType& type, const TString& name, const TString& mappedName, - TVariableInfoList& infoList) + TVariableInfoList& infoList, + ShHashFunction64 hashFunction) { if (type.getBasicType() == EbtStruct) { if (type.isArray()) { for (int i = 0; i < type.getArraySize(); ++i) { TString lname = name + arrayBrackets(i); TString lmappedName = mappedName + arrayBrackets(i); - getUserDefinedVariableInfo(type, lname, lmappedName, infoList); + getUserDefinedVariableInfo(type, lname, lmappedName, infoList, hashFunction); } } else { - getUserDefinedVariableInfo(type, name, mappedName, infoList); + getUserDefinedVariableInfo(type, name, mappedName, infoList, hashFunction); } } else { getBuiltInVariableInfo(type, name, mappedName, infoList); @@ -124,7 +126,8 @@ void getBuiltInVariableInfo(const TType& type, void getUserDefinedVariableInfo(const TType& type, const TString& name, const TString& mappedName, - TVariableInfoList& infoList) + TVariableInfoList& infoList, + ShHashFunction64 hashFunction) { ASSERT(type.getBasicType() == EbtStruct); @@ -133,8 +136,9 @@ void getUserDefinedVariableInfo(const TType& type, const TType* fieldType = (*structure)[i].type; getVariableInfo(*fieldType, name + "." + fieldType->getFieldName(), - mappedName + "." + fieldType->getFieldName(), - infoList); + mappedName + "." + TIntermTraverser::hash(fieldType->getFieldName(), hashFunction), + infoList, + hashFunction); } } @@ -149,9 +153,11 @@ TVariableInfo::TVariableInfo(ShDataType type, int size) } CollectAttribsUniforms::CollectAttribsUniforms(TVariableInfoList& attribs, - TVariableInfoList& uniforms) + TVariableInfoList& uniforms, + ShHashFunction64 hashFunction) : mAttribs(attribs), - mUniforms(uniforms) + mUniforms(uniforms), + mHashFunction(hashFunction) { } @@ -206,10 +212,16 @@ bool CollectAttribsUniforms::visitAggregate(Visit, TIntermAggregate* node) // cannot be initialized in a shader, we must have only // TIntermSymbol nodes in the sequence. ASSERT(variable != NULL); + TString processedSymbol; + if (mHashFunction == NULL) + processedSymbol = variable->getSymbol(); + else + processedSymbol = TIntermTraverser::hash(variable->getOriginalSymbol(), mHashFunction); getVariableInfo(variable->getType(), variable->getOriginalSymbol(), - variable->getSymbol(), - infoList); + processedSymbol, + infoList, + mHashFunction); } } break; |