[Mesa-dev] [PATCH] nir: remove dead glsl variables before lowering io.
Dave Airlie
airlied at gmail.com
Fri May 20 20:49:49 UTC 2016
From: Dave Airlie <airlied at redhat.com>
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).
Signed-off-by: Dave Airlie <airlied at redhat.com>
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
src/mesa/drivers/dri/i965/brw_nir.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/brw_nir.c b/src/mesa/drivers/dri/i965/brw_nir.c
index 9afd036..6ceac7e 100644
--- a/src/mesa/drivers/dri/i965/brw_nir.c
+++ b/src/mesa/drivers/dri/i965/brw_nir.c
@@ -560,6 +560,8 @@ 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_remove_dead_variables(nir, nir_var_shader_out);
OPT_V(nir_lower_io_to_temporaries,
nir_shader_get_entrypoint(nir),
true, false);
--
2.5.5
More information about the mesa-dev
mailing list