From a754413196e1af0ad6618148491311e40e60fa2b Mon Sep 17 00:00:00 2001 From: Yaski Date: Sun, 8 Jul 2012 04:57:27 +0600 Subject: [PATCH] Procedure: fix set attribute swizzle --- src/alternativa/engine3d/materials/compiler/Procedure.as | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/alternativa/engine3d/materials/compiler/Procedure.as b/src/alternativa/engine3d/materials/compiler/Procedure.as index 03336d9..8cd7330 100644 --- a/src/alternativa/engine3d/materials/compiler/Procedure.as +++ b/src/alternativa/engine3d/materials/compiler/Procedure.as @@ -258,7 +258,7 @@ use namespace alternativa3d; throw new Error("Expression is too complex. Output used as source."); } } - var maxSwizzle:uint = (aSwizzleLen > bSwizzleLen) ? aSwizzleLen : bSwizzleLen; + var maxSwizzle:uint; if (numInputs <= 1) { maxSwizzle = getSwizzleLen(a); } else { @@ -293,7 +293,7 @@ use namespace alternativa3d; var operand:String; if (numOperands == 3) { operand = operands[2]; - if (getSwizzleLen(operand) != 4 && getSwizzleLen(operand) != 1) { + if (getSwizzleLen(operand) != outputMaskLen && getSwizzleLen(operand) != 1) { throw new Error("Expression differs in size with output " + output + "."); } writeAGALExpression("mov " + output + " " + operand);