summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/angle/src/compiler/Types.h
diff options
context:
space:
mode:
authorSergio Ahumada <sergio.ahumada@digia.com>2013-04-10 15:41:47 +0200
committerSergio Ahumada <sergio.ahumada@digia.com>2013-04-10 15:42:22 +0200
commit90297a64f203959f90041887ea31f4bd04bc059a (patch)
tree86f8ad6a5af26fd618cdb2e20601e6df89ac94d6 /src/3rdparty/angle/src/compiler/Types.h
parent537a4bc4011d32de193dc31caf09a44c1810ab33 (diff)
parentf273d6fbc02055ff3999adc0df76360ca0670435 (diff)
Merge branch 'stable' into dev
Diffstat (limited to 'src/3rdparty/angle/src/compiler/Types.h')
-rw-r--r--src/3rdparty/angle/src/compiler/Types.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/3rdparty/angle/src/compiler/Types.h b/src/3rdparty/angle/src/compiler/Types.h
index d4576673b1..854bb44c07 100644
--- a/src/3rdparty/angle/src/compiler/Types.h
+++ b/src/3rdparty/angle/src/compiler/Types.h
@@ -136,6 +136,43 @@ public:
return totalSize;
}
+ int elementRegisterCount() const
+ {
+ TTypeList *structure = getStruct();
+
+ if (structure)
+ {
+ int registerCount = 0;
+
+ for (size_t i = 0; i < structure->size(); i++)
+ {
+ registerCount += (*structure)[i].type->totalRegisterCount();
+ }
+
+ return registerCount;
+ }
+ else if (isMatrix())
+ {
+ return getNominalSize();
+ }
+ else
+ {
+ return 1;
+ }
+ }
+
+ int totalRegisterCount() const
+ {
+ if (array)
+ {
+ return arraySize * elementRegisterCount();
+ }
+ else
+ {
+ return elementRegisterCount();
+ }
+ }
+
bool isMatrix() const { return matrix ? true : false; }
void setMatrix(bool m) { matrix = m; }