Procedure: fix set attribute swizzle

This commit is contained in:
Yaski
2012-07-08 04:57:27 +06:00
parent b5bf529a2c
commit a754413196

View File

@@ -258,7 +258,7 @@ use namespace alternativa3d;
throw new Error("Expression is too complex. Output used as source."); throw new Error("Expression is too complex. Output used as source.");
} }
} }
var maxSwizzle:uint = (aSwizzleLen > bSwizzleLen) ? aSwizzleLen : bSwizzleLen; var maxSwizzle:uint;
if (numInputs <= 1) { if (numInputs <= 1) {
maxSwizzle = getSwizzleLen(a); maxSwizzle = getSwizzleLen(a);
} else { } else {
@@ -293,7 +293,7 @@ use namespace alternativa3d;
var operand:String; var operand:String;
if (numOperands == 3) { if (numOperands == 3) {
operand = operands[2]; 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 + "."); throw new Error("Expression differs in size with output " + output + ".");
} }
writeAGALExpression("mov " + output + " " + operand); writeAGALExpression("mov " + output + " " + operand);