Add a secondary size field to the shader language types, to account for matrix rows. Also add some extra logic
to the promote method to check that the sizes of the arguments to multiplications are properly formed.
We require this extra information for non-square matrix support.
TRAC #23081
Signed-off-by: Geoff Lang
Signed-off-by: Nicolas Capens
Author: Jamie Madill
git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2392 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/SymbolTable.cpp b/src/compiler/SymbolTable.cpp
index ae1d7f2..c6e9fcb 100644
--- a/src/compiler/SymbolTable.cpp
+++ b/src/compiler/SymbolTable.cpp
@@ -21,7 +21,7 @@
#include "common/angleutils.h"
TType::TType(const TPublicType &p) :
- type(p.type), precision(p.precision), qualifier(p.qualifier), size(p.size), matrix(p.matrix), array(p.array), arraySize(p.arraySize),
+ type(p.type), precision(p.precision), qualifier(p.qualifier), primarySize(p.primarySize), secondarySize(p.secondarySize), array(p.array), arraySize(p.arraySize),
maxArraySize(0), arrayInformationType(0), interfaceBlockType(0), structure(0), structureSize(0), deepestStructNesting(0), fieldName(0), mangled(0), typeName(0)
{
if (p.userDef) {
@@ -76,7 +76,16 @@
break;
}
- mangledName += static_cast<char>('0' + getNominalSize());
+ if (isMatrix())
+ {
+ mangledName += static_cast<char>('0' + getCols());
+ mangledName += static_cast<char>('x');
+ mangledName += static_cast<char>('0' + getRows());
+ }
+ else
+ {
+ mangledName += static_cast<char>('0' + getNominalSize());
+ }
if (isArray()) {
char buf[20];
snprintf(buf, sizeof(buf), "%d", arraySize);