From 68df6a28a32559ae2e491db352b325d0b7a863f2 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 9 Jun 2011 01:59:49 -0400 Subject: [PATCH] Maybe fix scalar operations in preshader interpreter. --- mojoshader_effects.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mojoshader_effects.c b/mojoshader_effects.c index 714d0423..346341a8 100644 --- a/mojoshader_effects.c +++ b/mojoshader_effects.c @@ -39,14 +39,15 @@ void MOJOSHADER_runPreshader(const MOJOSHADER_preshader *preshader, 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) {