Mesa (master): i965: When splitting vector variable assignment, ignore unset channels.

Eric Anholt anholt at kemper.freedesktop.org
Wed Sep 22 21:59:11 UTC 2010


Module: Mesa
Branch: master
Commit: ac3d5beb0b20eb369b188aaf7b78f935969f3b62
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ac3d5beb0b20eb369b188aaf7b78f935969f3b62

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Sep 22 14:40:40 2010 -0700

i965: When splitting vector variable assignment, ignore unset channels.

The new checks for sanity in ir_assignment creation got angry about
this write_mask == 0.  Fixes:
glsl-fs-dot-vec2.
glsl-fs-atan-2
glsl-fs-dot-vec2

---

 .../drivers/dri/i965/brw_fs_vector_splitting.cpp   |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp
index d4da86b..9b58916 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp
@@ -271,12 +271,15 @@ ir_vector_splitting_visitor::visit_leave(ir_assignment *ir)
 	 void *mem_ctx = lhs ? lhs->mem_ctx : rhs->mem_ctx;
 	 unsigned int writemask;
 
+	 if (!(ir->write_mask & (1 << i)))
+	    continue;
+
 	 if (lhs) {
 	    new_lhs = new(mem_ctx) ir_dereference_variable(lhs->components[i]);
-	    writemask = (ir->write_mask >> i) & 1;
+	    writemask = 1;
 	 } else {
 	    new_lhs = ir->lhs->clone(mem_ctx, NULL);
-	    writemask = ir->write_mask & (1 << i);
+	    writemask = 1 << i;
 	 }
 
 	 if (rhs) {




More information about the mesa-commit mailing list