mesa: fix storage size computation in emit_arith()
authorBrian Paul <brian.paul@tungstengraphics.com>
Tue, 15 Jul 2008 20:41:47 +0000 (14:41 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Tue, 15 Jul 2008 22:40:38 +0000 (16:40 -0600)
src/mesa/shader/slang/slang_emit.c

index 6d79380ab5f3e83a394e62cf299c24fbd16ae36c..b087483b020685135f40a426e0cf0b9d9f382170 100644 (file)
@@ -539,8 +539,9 @@ emit_arith(slang_emit_info *emitInfo, slang_ir_node *n)
 
    /* result storage */
    if (!n->Store) {
-      /* XXX this size isn't correct, it depends on the operands */
-      if (!alloc_temp_storage(emitInfo, n, info->ResultSize))
+      GLint size = n->Children[0]->Store
+         ? n->Children[0]->Store->Size : info->ResultSize;
+      if (!alloc_temp_storage(emitInfo, n, size))
          return NULL;
    }
    storage_to_dst_reg(&inst->DstReg, n->Store, n->Writemask);