Maybe fix scalar operations in preshader interpreter.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 09 Jun 2011 01:59:49 -0400
changeset 1053 513af64373ad
parent 1052 0ac978521113
child 1054 63dd1a46ce13
Maybe fix scalar operations in preshader interpreter.
mojoshader_effects.c
--- a/mojoshader_effects.c	Thu Jun 09 01:56:10 2011 -0400
+++ b/mojoshader_effects.c	Thu Jun 09 01:59:49 2011 -0400
@@ -39,14 +39,15 @@
     for (instit = 0; instit < preshader->instruction_count; instit++, inst++)
     {
         const MOJOSHADER_preshaderOperand *operand = inst->operands;
-        const int isscalar = (inst->opcode >= scalarstart);
         const int elems = inst->element_count;
         const int elemsbytes = sizeof (double) * elems;
+        const int isscalarop = (inst->opcode >= scalarstart);
 
         // load up our operands...
         int opiter, elemiter;
         for (opiter = 0; opiter < inst->operand_count-1; opiter++, operand++)
         {
+            const int isscalar = ((isscalarop) && (opiter == 0));
             const unsigned int index = operand->index;
             switch (operand->type)
             {