diff options
Diffstat (limited to 'src/3rdparty/angle/src/compiler/translator/Types.cpp')
-rw-r--r-- | src/3rdparty/angle/src/compiler/translator/Types.cpp | 45 |
1 files changed, 39 insertions, 6 deletions
diff --git a/src/3rdparty/angle/src/compiler/translator/Types.cpp b/src/3rdparty/angle/src/compiler/translator/Types.cpp index b970bf5ac4..87fdfe0d54 100644 --- a/src/3rdparty/angle/src/compiler/translator/Types.cpp +++ b/src/3rdparty/angle/src/compiler/translator/Types.cpp @@ -46,9 +46,9 @@ const char* getBasicString(TBasicType t) } TType::TType(const TPublicType &p) - : type(p.type), precision(p.precision), qualifier(p.qualifier), layoutQualifier(p.layoutQualifier), - primarySize(p.primarySize), secondarySize(p.secondarySize), array(p.array), arraySize(p.arraySize), - interfaceBlock(0), structure(0) + : type(p.type), precision(p.precision), qualifier(p.qualifier), invariant(p.invariant), + layoutQualifier(p.layoutQualifier), primarySize(p.primarySize), secondarySize(p.secondarySize), + array(p.array), arraySize(p.arraySize), interfaceBlock(0), structure(0) { if (p.userDef) structure = p.userDef->getStruct(); @@ -59,6 +59,27 @@ bool TStructure::equals(const TStructure &other) const return (uniqueId() == other.uniqueId()); } +TString TType::getCompleteString() const +{ + TStringStream stream; + + if (invariant) + stream << "invariant "; + if (qualifier != EvqTemporary && qualifier != EvqGlobal) + stream << getQualifierString() << " "; + if (precision != EbpUndefined) + stream << getPrecisionString() << " "; + if (array) + stream << "array[" << getArraySize() << "] of "; + if (isMatrix()) + stream << getCols() << "X" << getRows() << " matrix of "; + else if (isVector()) + stream << getNominalSize() << "-component vector of "; + + stream << getBasicString(); + return stream.str(); +} + // // Recursively generate mangled names. // @@ -142,7 +163,8 @@ TString TType::buildMangledName() const mangledName += interfaceBlock->mangledName(); break; default: - UNREACHABLE(); + // EbtVoid, EbtAddress and non types + break; } if (isMatrix()) @@ -200,6 +222,17 @@ bool TStructure::containsArrays() const return false; } +bool TStructure::containsType(TBasicType type) const +{ + for (size_t i = 0; i < mFields->size(); ++i) + { + const TType *fieldType = (*mFields)[i]->type(); + if (fieldType->getBasicType() == type || fieldType->isStructureContainingType(type)) + return true; + } + return false; +} + bool TStructure::containsSamplers() const { for (size_t i = 0; i < mFields->size(); ++i) @@ -211,9 +244,9 @@ bool TStructure::containsSamplers() const return false; } -TString TFieldListCollection::buildMangledName() const +TString TFieldListCollection::buildMangledName(const TString &mangledNamePrefix) const { - TString mangledName(mangledNamePrefix()); + TString mangledName(mangledNamePrefix); mangledName += *mName; for (size_t i = 0; i < mFields->size(); ++i) { |