From 1105014c523e4859c67d44606b614158a50e8cde Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Tue, 19 Mar 2013 22:39:31 -0400 Subject: r300g: Fix bug in OMOD optimization https://bugs.freedesktop.org/show_bug.cgi?id=60503 NOTE: This is a candidate for the stable branches. (cherry picked from commit c6a86fb5639977f37a1403012669cdee86bbd89f) --- src/gallium/drivers/r300/compiler/radeon_optimize.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/r300/compiler/radeon_optimize.c b/src/gallium/drivers/r300/compiler/radeon_optimize.c index 734c7f2348..74afd6fbae 100644 --- a/src/gallium/drivers/r300/compiler/radeon_optimize.c +++ b/src/gallium/drivers/r300/compiler/radeon_optimize.c @@ -708,6 +708,7 @@ static int peephole_mul_omod( struct rc_list * writer_list; struct rc_variable * var; struct peephole_mul_cb_data cb_data; + unsigned writemask_sum; for (i = 0; i < 2; i++) { unsigned int j; @@ -815,10 +816,11 @@ static int peephole_mul_omod( } /* Rewrite the instructions */ + writemask_sum = rc_variable_writemask_sum(writer_list->Item); for (var = writer_list->Item; var; var = var->Friend) { struct rc_variable * writer = var; unsigned conversion_swizzle = rc_make_conversion_swizzle( - writer->Inst->U.I.DstReg.WriteMask, + writemask_sum, inst_mul->U.I.DstReg.WriteMask); writer->Inst->U.I.Omod = omod_op; writer->Inst->U.I.DstReg.File = inst_mul->U.I.DstReg.File; -- cgit v1.2.3