glsl: Ignore ir_texture in lower_const_arrays_to_uniforms.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 24 Jun 2016 22:37:35 +0000 (15:37 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 27 Jun 2016 23:36:30 +0000 (16:36 -0700)
The only part of an ir_texture which can be an array is the
offsets array in textureGatherOffsets() calls.  We don't want
to lower those, because they're required to remain constants.

Fixes textureGatherOffsets with Gallium drivers such as llvmpipe,
which commit ef78df8d3b0cf540e5f08c8c2f6caa338b64a6c7 regressed.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/compiler/glsl/lower_const_arrays_to_uniforms.cpp

index 99481505e0eba1a380f6c80425a907c581dec086..665a9ad1d486314302f0175116d47e0433c72ae3 100644 (file)
@@ -57,6 +57,7 @@ public:
       return progress;
    }
 
+   ir_visitor_status visit_enter(ir_texture *);
    void handle_rvalue(ir_rvalue **rvalue);
 
 private:
@@ -64,6 +65,12 @@ private:
    bool progress;
 };
 
+ir_visitor_status
+lower_const_array_visitor::visit_enter(ir_texture *)
+{
+   return visit_continue_with_parent;
+}
+
 void
 lower_const_array_visitor::handle_rvalue(ir_rvalue **rvalue)
 {