mesa: add missing size check for assignment optimization
authorBrian Paul <brian.paul@tungstengraphics.com>
Wed, 26 Nov 2008 16:35:08 +0000 (09:35 -0700)
committerBrian Paul <brian.paul@tungstengraphics.com>
Wed, 26 Nov 2008 16:35:08 +0000 (09:35 -0700)
src/mesa/shader/slang/slang_emit.c

index f31e9b4e6c73916b998f5302c7decc087e74afdb..e3cb252a3d7f01de900ba55c31f9a3144317bfa3 100644 (file)
@@ -1324,7 +1324,8 @@ emit_copy(slang_emit_info *emitInfo, slang_ir_node *n)
        _slang_is_temp(emitInfo->vt, n->Children[1]->Store) &&
        (inst->DstReg.File == n->Children[1]->Store->File) &&
        (inst->DstReg.Index == n->Children[1]->Store->Index) &&
-       !n->Children[0]->Store->IsIndirect) {
+       !n->Children[0]->Store->IsIndirect &&
+       n->Children[0]->Store->Size <= 4) {
       /* Peephole optimization:
        * The Right-Hand-Side has its results in a temporary place.
        * Modify the RHS (and the prev instruction) to store its results