aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/opt_vectorize.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/glsl/opt_vectorize.cpp')
-rw-r--r--mesalib/src/glsl/opt_vectorize.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/mesalib/src/glsl/opt_vectorize.cpp b/mesalib/src/glsl/opt_vectorize.cpp
index 28534a86a..2f71a8358 100644
--- a/mesalib/src/glsl/opt_vectorize.cpp
+++ b/mesalib/src/glsl/opt_vectorize.cpp
@@ -86,6 +86,7 @@ public:
virtual ir_visitor_status visit_enter(ir_expression *);
virtual ir_visitor_status visit_enter(ir_if *);
virtual ir_visitor_status visit_enter(ir_loop *);
+ virtual ir_visitor_status visit_enter(ir_texture *);
virtual ir_visitor_status visit_leave(ir_assignment *);
@@ -352,6 +353,18 @@ ir_vectorize_visitor::visit_enter(ir_loop *ir)
}
/**
+ * Upon entering an ir_texture, remove the current assignment from
+ * further consideration. Vectorizing multiple texture lookups into one
+ * is wrong.
+ */
+ir_visitor_status
+ir_vectorize_visitor::visit_enter(ir_texture *)
+{
+ this->current_assignment = NULL;
+ return visit_continue_with_parent;
+}
+
+/**
* Upon leaving an ir_assignment, save a pointer to it in ::assignment[] if
* the swizzle mask(s) found were appropriate. Also save a pointer in
* ::last_assignment so that we can compare future assignments with it.