summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-07-15 14:41:47 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-07-15 14:41:47 -0600
commit5bf89cf2c399e40b3d5dc8cf03f03db70f50e777 (patch)
tree1d1b8fab007926e7098775b4f3f0c3bbafbb17d9 /src/mesa
parentf006358d56e6b24c3e32665e088d5ee11877ec2c (diff)
mesa: fix storage size computation in emit_arith()
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/shader/slang/slang_emit.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c
index 6d79380ab5..b087483b02 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);