summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-04-10 21:51:27 -0600
committerBrian <[email protected]>2007-04-10 21:51:27 -0600
commitba876be0c0711f089c0cde9739f349b137430770 (patch)
tree958ea66f41e8e5db60e2ed456d5dd5510968b080 /src/mesa/shader
parent319ce38fa4984d4cfe8575126bb0d7aa10ef27a1 (diff)
fix/work-around allocation bugs for non-square matrices
Diffstat (limited to 'src/mesa/shader')
-rw-r--r--src/mesa/shader/slang/slang_codegen.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c
index ee82a107e0c..fe6b615c5d6 100644
--- a/src/mesa/shader/slang/slang_codegen.c
+++ b/src/mesa/shader/slang/slang_codegen.c
@@ -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: