<div dir="ltr"><div>Doesn't matter too much</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Sep 4, 2018 at 3:45 PM Andres Gomez <<a href="mailto:agomez@igalia.com">agomez@igalia.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Lionel, should we also include this in the stable queues ?<br>
<br>
<br>
On Mon, 2018-09-03 at 16:47 +0100, Lionel Landwerlin wrote:<br>
> We're hitting an assert in gfxbench because one of the local variable<br>
> is a sampler (according to Jason this isn't valid) :<br>
> <br>
> testfw_app: ../src/compiler/nir_types.cpp:551: void glsl_get_natural_size_align_bytes(const glsl_type*, unsigned int*, unsigned int*): Assertion `!"type does not have a natural size"' failed.<br>
> <br>
> Since this particular variable isn't used and it can be eliminated by<br>
> removing unused local variables in the optimization pass. This makes<br>
> sense also for valid local variables.<br>
> <br>
> v2: Move additional local variable removal out of optimization loop,<br>
> but before large constant removal (Jason/Lionel)<br>
> <br>
> Signed-off-by: Lionel Landwerlin <<a href="mailto:lionel.g.landwerlin@intel.com" target="_blank">lionel.g.landwerlin@intel.com</a>><br>
> ---<br>
> src/intel/compiler/brw_nir.c | 5 +++++<br>
> 1 file changed, 5 insertions(+)<br>
> <br>
> diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c<br>
> index ef5034d1e1e..8c1bcb99f8c 100644<br>
> --- a/src/intel/compiler/brw_nir.c<br>
> +++ b/src/intel/compiler/brw_nir.c<br>
> @@ -673,6 +673,11 @@ brw_preprocess_nir(const struct brw_compiler *compiler, nir_shader *nir)<br>
> <br>
> nir = brw_nir_optimize(nir, compiler, is_scalar, true);<br>
> <br>
> + /* Workaround Gfxbench unused local sampler variable which will trigger an<br>
> + * assert in the opt_large_constants pass.<br>
> + */<br>
> + OPT(nir_remove_dead_variables, nir_var_local);<br>
> +<br>
> /* This needs to be run after the first optimization pass but before we<br>
> * lower indirect derefs away<br>
> */<br>
-- <br>
Br,<br>
<br>
Andres<br>
</blockquote></div>