diff options
author | Timothy Arceri <tarceri@itsqueeze.com> | 2020-05-28 10:59:28 +1000 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2020-06-03 02:22:23 +0000 |
commit | 04dbf709edf069bc720d941fab27c53269336bcf (patch) | |
tree | e3c561c6c20d201d7b6cd2da5336afff921807e6 /src/gallium/drivers | |
parent | bc79442f3fa23ecb40fcc67ea3cf4fd73fb0d3fe (diff) |
nir: add callback to nir_remove_dead_variables()
This allows us to do API specific checks before removing variable
without filling nir_remove_dead_variables() with API specific code.
In the following patches we will use this to support the removal
of dead uniforms in GLSL.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4797>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a2xx/ir2_nir.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/lima/lima_program.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp | 2 | ||||
-rw-r--r-- | src/gallium/drivers/r600/sfn/sfn_nir.cpp | 4 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader_nir.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/v3d/v3d_program.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/vc4/vc4_program.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/zink/zink_compiler.c | 2 |
9 files changed, 11 insertions, 11 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c b/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c index c731067f542..4542f429ddc 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c +++ b/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c @@ -839,7 +839,7 @@ etna_compile_shader_nir(struct etna_shader_variant *v) while( OPT(s, nir_opt_vectorize) ); OPT_V(s, nir_lower_alu_to_scalar, etna_alu_to_scalar_filter_cb, specs); - NIR_PASS_V(s, nir_remove_dead_variables, nir_var_function_temp); + NIR_PASS_V(s, nir_remove_dead_variables, nir_var_function_temp, NULL); NIR_PASS_V(s, nir_opt_algebraic_late); NIR_PASS_V(s, nir_move_vec_src_uses_to_dest); diff --git a/src/gallium/drivers/freedreno/a2xx/ir2_nir.c b/src/gallium/drivers/freedreno/a2xx/ir2_nir.c index 53a3c0a6649..44e53afaa3c 100644 --- a/src/gallium/drivers/freedreno/a2xx/ir2_nir.c +++ b/src/gallium/drivers/freedreno/a2xx/ir2_nir.c @@ -122,7 +122,7 @@ ir2_optimize_nir(nir_shader *s, bool lower) ir2_optimize_loop(s); - OPT_V(s, nir_remove_dead_variables, nir_var_function_temp); + OPT_V(s, nir_remove_dead_variables, nir_var_function_temp, NULL); OPT_V(s, nir_opt_sink, nir_move_const_undef); /* TODO we dont want to get shaders writing to depth for depth textures */ diff --git a/src/gallium/drivers/lima/lima_program.c b/src/gallium/drivers/lima/lima_program.c index 2537e770ef9..0d942d47126 100644 --- a/src/gallium/drivers/lima/lima_program.c +++ b/src/gallium/drivers/lima/lima_program.c @@ -138,7 +138,7 @@ lima_program_optimize_vs_nir(struct nir_shader *s) NIR_PASS_V(s, nir_opt_dce); NIR_PASS_V(s, nir_lower_locals_to_regs); NIR_PASS_V(s, nir_convert_from_ssa, true); - NIR_PASS_V(s, nir_remove_dead_variables, nir_var_function_temp); + NIR_PASS_V(s, nir_remove_dead_variables, nir_var_function_temp, NULL); nir_sweep(s); } @@ -243,7 +243,7 @@ lima_program_optimize_fs_nir(struct nir_shader *s, NIR_PASS_V(s, nir_lower_locals_to_regs); NIR_PASS_V(s, nir_convert_from_ssa, true); - NIR_PASS_V(s, nir_remove_dead_variables, nir_var_function_temp); + NIR_PASS_V(s, nir_remove_dead_variables, nir_var_function_temp, NULL); NIR_PASS_V(s, nir_move_vec_src_uses_to_dest); NIR_PASS_V(s, nir_lower_vec_to_movs); diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp index bd78b76f384..50c8345e4b6 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp @@ -3239,7 +3239,7 @@ Converter::run() NIR_PASS_V(nir, nir_lower_bool_to_int32); NIR_PASS_V(nir, nir_lower_locals_to_regs); - NIR_PASS_V(nir, nir_remove_dead_variables, nir_var_function_temp); + NIR_PASS_V(nir, nir_remove_dead_variables, nir_var_function_temp, NULL); NIR_PASS_V(nir, nir_convert_from_ssa, true); // Garbage collect dead instructions diff --git a/src/gallium/drivers/r600/sfn/sfn_nir.cpp b/src/gallium/drivers/r600/sfn/sfn_nir.cpp index 3f8badf6fc3..571498a8f4b 100644 --- a/src/gallium/drivers/r600/sfn/sfn_nir.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_nir.cpp @@ -635,8 +635,8 @@ int r600_shader_from_nir(struct r600_context *rctx, if (optimize) while(optimize_once(sel->nir)); - NIR_PASS_V(sel->nir, nir_remove_dead_variables, nir_var_shader_in); - NIR_PASS_V(sel->nir, nir_remove_dead_variables, nir_var_shader_out); + NIR_PASS_V(sel->nir, nir_remove_dead_variables, nir_var_shader_in, NULL); + NIR_PASS_V(sel->nir, nir_remove_dead_variables, nir_var_shader_out, NULL); NIR_PASS_V(sel->nir, nir_lower_vars_to_scratch, diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c index 6b8bea1c11c..7ce107e1b0f 100644 --- a/src/gallium/drivers/radeonsi/si_shader_nir.c +++ b/src/gallium/drivers/radeonsi/si_shader_nir.c @@ -934,7 +934,7 @@ static void si_lower_nir(struct si_screen *sscreen, struct nir_shader *nir) si_nir_opts(nir); NIR_PASS_V(nir, nir_lower_bool_to_int32); - NIR_PASS_V(nir, nir_remove_dead_variables, nir_var_function_temp); + NIR_PASS_V(nir, nir_remove_dead_variables, nir_var_function_temp, NULL); if (sscreen->debug_flags & DBG(FS_CORRECT_DERIVS_AFTER_KILL)) NIR_PASS_V(nir, nir_lower_discard_to_demote); diff --git a/src/gallium/drivers/v3d/v3d_program.c b/src/gallium/drivers/v3d/v3d_program.c index ad6a796866a..dbe3c7b4454 100644 --- a/src/gallium/drivers/v3d/v3d_program.c +++ b/src/gallium/drivers/v3d/v3d_program.c @@ -322,7 +322,7 @@ v3d_uncompiled_shader_create(struct pipe_context *pctx, v3d_optimize_nir(s); - NIR_PASS_V(s, nir_remove_dead_variables, nir_var_function_temp); + NIR_PASS_V(s, nir_remove_dead_variables, nir_var_function_temp, NULL); /* Garbage collect dead instructions */ nir_sweep(s); diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c index 66a095e1216..2d16c479313 100644 --- a/src/gallium/drivers/vc4/vc4_program.c +++ b/src/gallium/drivers/vc4/vc4_program.c @@ -2482,7 +2482,7 @@ vc4_shader_state_create(struct pipe_context *pctx, vc4_optimize_nir(s); - NIR_PASS_V(s, nir_remove_dead_variables, nir_var_function_temp); + NIR_PASS_V(s, nir_remove_dead_variables, nir_var_function_temp, NULL); /* Garbage collect dead instructions */ nir_sweep(s); diff --git a/src/gallium/drivers/zink/zink_compiler.c b/src/gallium/drivers/zink/zink_compiler.c index 98ef706fb8f..d3efcb987a6 100644 --- a/src/gallium/drivers/zink/zink_compiler.c +++ b/src/gallium/drivers/zink/zink_compiler.c @@ -140,7 +140,7 @@ zink_compile_nir(struct zink_screen *screen, struct nir_shader *nir) NIR_PASS_V(nir, nir_lower_clip_halfz); NIR_PASS_V(nir, nir_lower_regs_to_ssa); optimize_nir(nir); - NIR_PASS_V(nir, nir_remove_dead_variables, nir_var_function_temp); + NIR_PASS_V(nir, nir_remove_dead_variables, nir_var_function_temp, NULL); NIR_PASS_V(nir, lower_discard_if); NIR_PASS_V(nir, nir_convert_from_ssa, true); |