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.

Cc: Eric Anholt <e...@anholt.net>
Cc: Matt Turner <matts...@gmail.com>
Cc: Christopher James Halse Rogers <chalserog...@gmail.com>
Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
---
 .../drivers/dri/i965/brw_vec4_copy_propagation.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Matt and Christopher,

Could you test Counter Strike and Civ V with this patch series?
I think it should solve your regressions with the new VS backend.

Thanks!

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 93ae3d6..95aa306 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 &&
-- 
1.7.7.3

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to