aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2016-05-21 06:48:05 +1000
committerDave Airlie <[email protected]>2016-05-21 08:56:45 +1000
commit0970c563d6e4a30ab0852ef664dc97a995997f88 (patch)
treead14d2668f267bc1fba82f12bd3d6d03f94cec32 /src
parentde45da6a8c3091de400adc468682779abc989109 (diff)
nir: remove dead glsl variables before lowering io.
For cull distance GLSL will let unsized unused arrays get into the backend, we should nuke those straight away, to save caring about them later. This fixes: arb_separate_shader_objects/linker/large-number-of-unused-varyings as a side effect (even without culling changes). Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_nir.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_nir.c b/src/mesa/drivers/dri/i965/brw_nir.c
index 372b746453e..9274f2e1616 100644
--- a/src/mesa/drivers/dri/i965/brw_nir.c
+++ b/src/mesa/drivers/dri/i965/brw_nir.c
@@ -561,6 +561,7 @@ brw_create_nir(struct brw_context *brw,
/* First, lower the GLSL IR or Mesa IR to NIR */
if (shader_prog) {
nir = glsl_to_nir(shader_prog, stage, options);
+ nir_remove_dead_variables(nir, nir_var_shader_in | nir_var_shader_out);
OPT_V(nir_lower_io_to_temporaries,
nir_shader_get_entrypoint(nir),
true, false);