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 <marek.olsak@amd.com>
This commit is contained in:
Timothy Arceri
2018-01-29 17:33:57 +11:00
parent 327c1a7fb3
commit 2b4afaef1c
@@ -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;