From: Timothy Arceri Date: Mon, 29 Jan 2018 06:33:57 +0000 (+1100) Subject: st/glsl_to_nir: remove dead io after conversion to nir X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2b4afaef1c4e0aeb75be570651bacf3ac7c9838d;p=mesa.git st/glsl_to_nir: remove dead io after conversion to nir This fixes an assert in nir_lower_var_copies() for some bioshock shaders where an unused clipdistance array has no size. Reviewed-by: Marek Olšák --- diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index 2de767625af..8639544142e 100644 --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp @@ -319,6 +319,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;