fix/work-around allocation bugs for non-square matrices
authorBrian <brian@yutani.localnet.net>
Wed, 11 Apr 2007 03:51:27 +0000 (21:51 -0600)
committerBrian <brian@yutani.localnet.net>
Wed, 11 Apr 2007 03:51:27 +0000 (21:51 -0600)
src/mesa/shader/slang/slang_codegen.c

index ee82a107e0c472d77651741d74726f3c1cc36940..fe6b615c5d6ea322569c7c0f7a73d3ffe3c1bf51 100644 (file)
@@ -144,14 +144,17 @@ _slang_sizeof_type_specifier(const slang_type_specifier *spec)
    case SLANG_SPEC_MAT4:
       return 4 * 4;
    case SLANG_SPEC_MAT23:
+      return 2 * 4; /* special case */
    case SLANG_SPEC_MAT32:
-      return 2 * 3;
+      return 3 * 4; /* special case: 3 registers (columns), not two */
    case SLANG_SPEC_MAT24:
-   case SLANG_SPEC_MAT42:
       return 2 * 4;
+   case SLANG_SPEC_MAT42:
+      return 4 * 4; /* special case: 4 registers (columns), not two */
    case SLANG_SPEC_MAT34:
-   case SLANG_SPEC_MAT43:
       return 3 * 4;
+   case SLANG_SPEC_MAT43:
+      return 4 * 4; /* special case: 4 registers (columns), not two */
    case SLANG_SPEC_SAMPLER1D:
    case SLANG_SPEC_SAMPLER2D:
    case SLANG_SPEC_SAMPLER3D: