From 443c8d1ab7ddad9392046e041e4e9a4fda7cd6e7 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Fri, 23 Dec 2011 19:57:08 -0800 Subject: [PATCH] i965/vs: Fix incorrect subscript when resetting copy propagation records. In this code, 'i' loops over the number of virtual GRFs, while 'j' loops over the number of vector components (0 <= j <= 3). It can't possibly be correct to see if bit 'i' is set in the destination writemask, as it will have values much larger than 3. Clearly this is supposed to be 'j'. Found by inspection. Tested-by: Matt Turner Tested-by: Christopher James Halse Rogers Reviewed-by: Eric Anholt Signed-off-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp index 93ae3d61cac..95aa30614b1 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp @@ -323,7 +323,7 @@ vec4_visitor::opt_copy_propagation() for (int i = 0; i < virtual_grf_reg_count; i++) { for (int j = 0; j < 4; j++) { - if (inst->dst.writemask & (1 << i) && + if (inst->dst.writemask & (1 << j) && cur_value[i][j] && cur_value[i][j]->file == GRF && cur_value[i][j]->reg == inst->dst.reg && -- 2.30.2