From 1ddfbe99ac2275f4036ae8f044e1d47d2db4f894 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Sat, 14 Jan 2012 01:44:15 -0800 Subject: [PATCH] i965/fs: Don't allow vectors in try_rewrite_rhs_to_dst. In SOA mode, vectors are stored in up to four separate registers, and cannot be moved by a single instruction---it takes one per component. Unfortunately, the try_rewrite_rhs_to_dst optimization breaks for assignments of whole vectors: it rewrites the last instruction that generated part of the RHS to point at the MOV's dst.x and blithely reports that no further work is necessary. The y, z, and w components never get copied. Signed-off-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp index 44c9ee8..e096d7c 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp @@ -551,10 +551,7 @@ fs_visitor::try_rewrite_rhs_to_dst(ir_assignment *ir, return false; /* No instructions generated to work with. */ /* Only attempt if we're doing a direct assignment. */ - if (ir->condition || - !(ir->lhs->type->is_scalar() || - (ir->lhs->type->is_vector() && - ir->write_mask == (1 << ir->lhs->type->vector_elements) - 1))) + if (ir->condition || !ir->lhs->type->is_scalar()) return false; /* Make sure the last instruction generated our source reg. */ -- 1.7.7.5