[Mesa-dev] [PATCH 5/7] i965/nir: Add a nir_lower_uniforms helper

Matt Turner mattst88 at gmail.com
Mon Nov 23 20:50:25 PST 2015


On Mon, Nov 23, 2015 at 6:11 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> This matches what we're already doing for inputs and outputs
> ---
>  src/mesa/drivers/dri/i965/brw_nir.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_nir.c b/src/mesa/drivers/dri/i965/brw_nir.c
> index 91358d8..e602df7 100644
> --- a/src/mesa/drivers/dri/i965/brw_nir.c
> +++ b/src/mesa/drivers/dri/i965/brw_nir.c
> @@ -171,6 +171,14 @@ brw_nir_lower_outputs(nir_shader *nir, bool is_scalar)
>     }
>  }
>
> +static void
> +brw_nir_lower_uniforms(nir_shader *nir, bool is_scalar)
> +{
> +   nir_assign_var_locations(&nir->uniforms,
> +                            &nir->num_uniforms,
> +                            is_scalar ? type_size_scalar : type_size_vec4);
> +}
> +
>  static bool
>  should_clone_nir()
>  {
> @@ -298,6 +306,7 @@ brw_lower_nir(nir_shader *nir,
>
>     OPT_V(brw_nir_lower_inputs, devinfo, is_scalar);
>     OPT_V(brw_nir_lower_outputs, is_scalar);
> +   OPT_V(brw_nir_lower_uniforms, is_scalar);
>     nir_assign_var_locations(&nir->uniforms,
>                              &nir->num_uniforms,
>                              is_scalar ? type_size_scalar : type_size_vec4);

Did you mean to delete this?


More information about the mesa-dev mailing list