[Mesa-dev] [PATCH] glsl: Ignore ir_texture in lower_const_arrays_to_uniforms.

Ilia Mirkin imirkin at alum.mit.edu
Fri Jun 24 23:03:35 UTC 2016


On Fri, Jun 24, 2016 at 6:41 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> 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.

I believe you need to also CC this to stable, as that one was tagged
for stable as well.

I suppose you could have a situation like

vec2 coords[] = { ... }

texture(coords[n])

in which case this won't cause the coords array to get lowered?

  -ilia

> Cc: Michel Dänzer <michel at daenzer.net>
> Cc: Ilia Mirkin <imirkin at alum.mit.edu>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/compiler/glsl/lower_const_arrays_to_uniforms.cpp | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/src/compiler/glsl/lower_const_arrays_to_uniforms.cpp b/src/compiler/glsl/lower_const_arrays_to_uniforms.cpp
> index 9948150..665a9ad 100644
> --- a/src/compiler/glsl/lower_const_arrays_to_uniforms.cpp
> +++ b/src/compiler/glsl/lower_const_arrays_to_uniforms.cpp
> @@ -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)
>  {
> --
> 2.9.0
>


More information about the mesa-dev mailing list