summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/angle/src/compiler/translator/Types.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/angle/src/compiler/translator/Types.cpp')
-rw-r--r--src/3rdparty/angle/src/compiler/translator/Types.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/3rdparty/angle/src/compiler/translator/Types.cpp b/src/3rdparty/angle/src/compiler/translator/Types.cpp
index d36936fb23..b970bf5ac4 100644
--- a/src/3rdparty/angle/src/compiler/translator/Types.cpp
+++ b/src/3rdparty/angle/src/compiler/translator/Types.cpp
@@ -178,11 +178,12 @@ size_t TType::getObjectSize() const
if (isArray())
{
- size_t arraySize = getArraySize();
- if (arraySize > INT_MAX / totalSize)
+ // TODO: getArraySize() returns an int, not a size_t
+ size_t currentArraySize = getArraySize();
+ if (currentArraySize > INT_MAX / totalSize)
totalSize = INT_MAX;
else
- totalSize *= arraySize;
+ totalSize *= currentArraySize;
}
return totalSize;
@@ -199,6 +200,17 @@ bool TStructure::containsArrays() const
return false;
}
+bool TStructure::containsSamplers() const
+{
+ for (size_t i = 0; i < mFields->size(); ++i)
+ {
+ const TType *fieldType = (*mFields)[i]->type();
+ if (IsSampler(fieldType->getBasicType()) || fieldType->isStructureContainingSamplers())
+ return true;
+ }
+ return false;
+}
+
TString TFieldListCollection::buildMangledName() const
{
TString mangledName(mangledNamePrefix());