From c80877b5357f4103335d4dcdae5ed923bfb259e0 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Wed, 31 Mar 2021 10:55:57 +0200 Subject: [PATCH] r600/sfn: lower to scalar with filter applied Signed-off-by: Gert Wollny Reviewed-by: Timothy Arceri Part-of: --- src/gallium/drivers/r600/r600_pipe_common.c | 4 ++++ src/gallium/drivers/r600/sfn/sfn_nir.cpp | 3 +-- src/gallium/drivers/r600/sfn/sfn_nir.h | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/r600/r600_pipe_common.c b/src/gallium/drivers/r600/r600_pipe_common.c index fe3d0c6..9599ba7 100644 --- a/src/gallium/drivers/r600/r600_pipe_common.c +++ b/src/gallium/drivers/r600/r600_pipe_common.c @@ -1181,6 +1181,8 @@ r600_get_compiler_options(struct pipe_screen *screen, return &rscreen->nir_options; } +extern bool r600_lower_to_scalar_instr_filter(const nir_instr *instr, const void *); + bool r600_common_screen_init(struct r600_common_screen *rscreen, struct radeon_winsys *ws) { @@ -1330,6 +1332,8 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen, .lower_bitfield_insert_to_bitfield_select = true, .has_fused_comp_and_csel = true, .lower_find_msb_to_reverse = true, + .lower_to_scalar = true, + .lower_to_scalar_filter = r600_lower_to_scalar_instr_filter, }; rscreen->nir_options = nir_options; diff --git a/src/gallium/drivers/r600/sfn/sfn_nir.cpp b/src/gallium/drivers/r600/sfn/sfn_nir.cpp index b421f83..6314db5 100644 --- a/src/gallium/drivers/r600/sfn/sfn_nir.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_nir.cpp @@ -810,6 +810,7 @@ bool has_saturate(const nir_function *func) return false; } +extern "C" bool r600_lower_to_scalar_instr_filter(const nir_instr *instr, const void *) { if (instr->type != nir_instr_type_alu) @@ -875,8 +876,6 @@ int r600_shader_from_nir(struct r600_context *rctx, NIR_PASS_V(sel->nir, nir_lower_int64); while(optimize_once(sel->nir, false)); - NIR_PASS_V(sel->nir, nir_lower_alu_to_scalar, r600_lower_to_scalar_instr_filter, NULL); - NIR_PASS_V(sel->nir, r600_lower_shared_io); NIR_PASS_V(sel->nir, r600_nir_lower_atomics); diff --git a/src/gallium/drivers/r600/sfn/sfn_nir.h b/src/gallium/drivers/r600/sfn/sfn_nir.h index d13accb..6bac550 100644 --- a/src/gallium/drivers/r600/sfn/sfn_nir.h +++ b/src/gallium/drivers/r600/sfn/sfn_nir.h @@ -146,6 +146,7 @@ extern "C" { bool r600_vectorize_vs_inputs(nir_shader *shader); +bool r600_lower_to_scalar_instr_filter(const nir_instr *instr, const void *); int r600_shader_from_nir(struct r600_context *rctx, struct r600_pipe_shader *pipeshader, -- 2.7.4