diff options
Diffstat (limited to 'Source/ThirdParty/ANGLE/src/compiler/VariableInfo.cpp')
-rw-r--r-- | Source/ThirdParty/ANGLE/src/compiler/VariableInfo.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/Source/ThirdParty/ANGLE/src/compiler/VariableInfo.cpp b/Source/ThirdParty/ANGLE/src/compiler/VariableInfo.cpp index ad2e08f..1e9486f 100644 --- a/Source/ThirdParty/ANGLE/src/compiler/VariableInfo.cpp +++ b/Source/ThirdParty/ANGLE/src/compiler/VariableInfo.cpp @@ -63,6 +63,8 @@ static ShDataType getVariableDataType(const TType& type) } case EbtSampler2D: return SH_SAMPLER_2D; case EbtSamplerCube: return SH_SAMPLER_CUBE; + case EbtSamplerExternalOES: return SH_SAMPLER_EXTERNAL_OES; + case EbtSampler2DRect: return SH_SAMPLER_2D_RECT_ARB; default: UNREACHABLE(); } return SH_NONE; @@ -70,32 +72,37 @@ static ShDataType getVariableDataType(const TType& type) static void getBuiltInVariableInfo(const TType& type, const TString& name, + const TString& mappedName, TVariableInfoList& infoList); static void getUserDefinedVariableInfo(const TType& type, const TString& name, + const TString& mappedName, TVariableInfoList& infoList); // Returns info for an attribute or uniform. static void getVariableInfo(const TType& type, const TString& name, + const TString& mappedName, TVariableInfoList& infoList) { if (type.getBasicType() == EbtStruct) { if (type.isArray()) { for (int i = 0; i < type.getArraySize(); ++i) { TString lname = name + arrayBrackets(i); - getUserDefinedVariableInfo(type, lname, infoList); + TString lmappedName = mappedName + arrayBrackets(i); + getUserDefinedVariableInfo(type, lname, lmappedName, infoList); } } else { - getUserDefinedVariableInfo(type, name, infoList); + getUserDefinedVariableInfo(type, name, mappedName, infoList); } } else { - getBuiltInVariableInfo(type, name, infoList); + getBuiltInVariableInfo(type, name, mappedName, infoList); } } void getBuiltInVariableInfo(const TType& type, const TString& name, + const TString& mappedName, TVariableInfoList& infoList) { ASSERT(type.getBasicType() != EbtStruct); @@ -103,9 +110,11 @@ void getBuiltInVariableInfo(const TType& type, TVariableInfo varInfo; if (type.isArray()) { varInfo.name = (name + "[0]").c_str(); + varInfo.mappedName = (mappedName + "[0]").c_str(); varInfo.size = type.getArraySize(); } else { varInfo.name = name.c_str(); + varInfo.mappedName = mappedName.c_str(); varInfo.size = 1; } varInfo.type = getVariableDataType(type); @@ -114,16 +123,17 @@ void getBuiltInVariableInfo(const TType& type, void getUserDefinedVariableInfo(const TType& type, const TString& name, + const TString& mappedName, TVariableInfoList& infoList) { ASSERT(type.getBasicType() == EbtStruct); - TString lname = name + "."; const TTypeList* structure = type.getStruct(); for (size_t i = 0; i < structure->size(); ++i) { const TType* fieldType = (*structure)[i].type; getVariableInfo(*fieldType, - lname + fieldType->getFieldName(), + name + "." + fieldType->getFieldName(), + mappedName + "." + fieldType->getFieldName(), infoList); } } @@ -186,7 +196,9 @@ bool CollectAttribsUniforms::visitAggregate(Visit, TIntermAggregate* node) // cannot be initialized in a shader, we must have only // TIntermSymbol nodes in the sequence. ASSERT(variable != NULL); - getVariableInfo(variable->getType(), variable->getSymbol(), + getVariableInfo(variable->getType(), + variable->getOriginalSymbol(), + variable->getSymbol(), infoList); } } |