[Mesa-dev] [PATCH] st/glsl_to_nir: remove dead io after conversion to nir

Marek Olšák maraeo at gmail.com
Mon Jan 29 21:36:36 UTC 2018


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Mon, Jan 29, 2018 at 7:36 AM, Timothy Arceri <tarceri at itsqueeze.com> wrote:
> This fixes an assert in nir_lower_var_copies() for some bioshock
> shaders where an unused clipdistance array has no size.
> ---
>  src/mesa/state_tracker/st_glsl_to_nir.cpp | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp
> index 02378bc796..34850fb88c 100644
> --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
> +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
> @@ -313,6 +313,10 @@ st_glsl_to_nir(struct st_context *st, struct gl_program *prog,
>
>     nir_shader *nir = glsl_to_nir(shader_program, stage, options);
>
> +   nir_variable_mode mask =
> +      (nir_variable_mode) (nir_var_shader_in | nir_var_shader_out);
> +   nir_remove_dead_variables(nir, mask);
> +
>     st_nir_opts(nir);
>
>     return nir;
> --
> 2.14.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list