From 2b4afaef1c4e0aeb75be570651bacf3ac7c9838d Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Mon, 29 Jan 2018 17:33:57 +1100 Subject: [PATCH] st/glsl_to_nir: remove dead io after conversion to nir MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- 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 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; -- 2.30.2