From 5bf89cf2c399e40b3d5dc8cf03f03db70f50e777 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 15 Jul 2008 14:41:47 -0600 Subject: mesa: fix storage size computation in emit_arith() --- src/mesa/shader/slang/slang_emit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/mesa/shader/slang') diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index 6d79380ab5f..b087483b020 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -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); -- cgit v1.2.3