summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2018-01-29 17:33:57 +1100
committerTimothy Arceri <[email protected]>2018-01-30 09:14:36 +1100
commit2b4afaef1c4e0aeb75be570651bacf3ac7c9838d (patch)
treedd87a5a855dc6af1a094cfe5c490b9b72740ca94 /src
parent327c1a7fb3c30b639112f0d3f7c4a9b768434381 (diff)
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 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_glsl_to_nir.cpp4
1 files changed, 4 insertions, 0 deletions
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;