Add non-square mat support to the shader language interface.

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@2397 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/VariableInfo.cpp b/src/compiler/VariableInfo.cpp
index a1f41ad..388fe7d 100644
--- a/src/compiler/VariableInfo.cpp
+++ b/src/compiler/VariableInfo.cpp
@@ -19,11 +19,32 @@
     switch (type.getBasicType()) {
       case EbtFloat:
           if (type.isMatrix()) {
-              switch (type.getRows()) {
-                case 2: return SH_FLOAT_MAT2;
-                case 3: return SH_FLOAT_MAT3;
-                case 4: return SH_FLOAT_MAT4;
-                default: UNREACHABLE();
+              switch (type.getCols())
+              {
+                case 2:
+                  switch (type.getRows())
+                  {
+                    case 2: return SH_FLOAT_MAT2;
+                    case 3: return SH_FLOAT_MAT2x3;
+                    case 4: return SH_FLOAT_MAT2x4;
+                    default: UNREACHABLE();
+                  }
+                case 3:
+                  switch (type.getRows())
+                  {
+                    case 2: return SH_FLOAT_MAT3x2;
+                    case 3: return SH_FLOAT_MAT3;
+                    case 4: return SH_FLOAT_MAT3x4;
+                    default: UNREACHABLE();
+                  }
+                case 4:
+                  switch (type.getRows())
+                  {
+                    case 2: return SH_FLOAT_MAT4x2;
+                    case 3: return SH_FLOAT_MAT4x3;
+                    case 4: return SH_FLOAT_MAT4;
+                    default: UNREACHABLE();
+                  }
               }
           } else if (type.isVector()) {
               switch (type.getNominalSize()) {