<p dir="ltr"><br>
On Nov 13, 2015 5:25 AM, "Iago Toral" <<a href="mailto:itoral@igalia.com">itoral@igalia.com</a>> wrote:<br>
><br>
> On Wed, 2015-11-11 at 17:26 -0800, Jason Ekstrand wrote:<br>
> > ---<br>
> > src/glsl/nir/nir.h | 2 +-<br>
> > src/glsl/nir/nir_lower_tex.c | 19 +++++++++++++++----<br>
> > 2 files changed, 16 insertions(+), 5 deletions(-)<br>
> ><br>
> > diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h<br>
> > index 41125b1..2299ece 100644<br>
> > --- a/src/glsl/nir/nir.h<br>
> > +++ b/src/glsl/nir/nir.h<br>
> > @@ -1981,7 +1981,7 @@ typedef struct nir_lower_tex_options {<br>
> > unsigned saturate_r;<br>
> > } nir_lower_tex_options;<br>
> ><br>
> > -void nir_lower_tex(nir_shader *shader,<br>
> > +bool nir_lower_tex(nir_shader *shader,<br>
> > const nir_lower_tex_options *options);<br>
> ><br>
> > void nir_lower_idiv(nir_shader *shader);<br>
> > diff --git a/src/glsl/nir/nir_lower_tex.c b/src/glsl/nir/nir_lower_tex.c<br>
> > index 8aaa48a..21ed103 100644<br>
> > --- a/src/glsl/nir/nir_lower_tex.c<br>
> > +++ b/src/glsl/nir/nir_lower_tex.c<br>
> > @@ -41,6 +41,7 @@<br>
> > typedef struct {<br>
> > nir_builder b;<br>
> > const nir_lower_tex_options *options;<br>
> > + bool progress;<br>
> > } lower_tex_state;<br>
> ><br>
> > static void<br>
> > @@ -239,15 +240,21 @@ nir_lower_tex_block(nir_block *block, void *void_state)<br>
> > /* If we are clamping any coords, we must lower projector first<br>
> > * as clamping happens *after* projection:<br>
> > */<br>
> > - if (lower_txp || sat_mask)<br>
> > + if (lower_txp || sat_mask) {<br>
> > project_src(b, tex);<br>
> > + state->progress = true;<br>
> > + }<br>
> ><br>
> > if ((tex->sampler_dim == GLSL_SAMPLER_DIM_RECT) &&<br>
> > - state->options->lower_rect)<br>
> > + state->options->lower_rect) {<br>
> > lower_rect(b, tex);<br>
> > + state->progress = true;<br>
> > + }<br>
> ><br>
> > - if (sat_mask)<br>
> > + if (sat_mask) {<br>
> > saturate_src(b, tex, sat_mask);<br>
> > + state->progress = true;<br>
> > + }<br>
> > }<br>
> ><br>
> > return true;<br>
> > @@ -264,13 +271,17 @@ nir_lower_tex_impl(nir_function_impl *impl, lower_tex_state *state)<br>
> > nir_metadata_dominance);<br>
> > }<br>
> ><br>
> > -void<br>
> > +bool<br>
> > nir_lower_tex(nir_shader *shader, const nir_lower_tex_options *options)<br>
> > {<br>
> > lower_tex_state state;<br>
> > state.options = options;<br>
> > + state.progress = false;<br>
> > +<br>
> > nir_foreach_overload(shader, overload) {<br>
> > if (overload->impl)<br>
> > nir_lower_tex_impl(overload->impl, &state);<br>
> > }<br>
> > +<br>
> > + return state.progress;<br>
> > }<br>
><br>
> If we are making this change then we also want to make the call to this<br>
> pass use OPT() instead of OPT_V() in brw_preprocess_nir(), so it is<br>
> consistent with patch 3 in this series.</p>
<p dir="ltr">Good call. Will do.</p>
<p dir="ltr">> With that change,<br>
> Reviewed-by: Iago Toral Quiroga <<a href="mailto:itoral@igalia.com">itoral@igalia.com</a>><br>
><br>
> Iago<br>
><br>
</p>