From 9dc6ea2fada91c03c4b19a1dcdf5e31b28ff23d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Ondra=C4=8Dka?= Date: Tue, 9 Apr 2024 22:09:55 +0200 Subject: [PATCH] r300: remove nir_to_rc_options wrapper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Just call nir_to_rc directly since we don't have any options anymore. Signed-off-by: Pavel Ondračka Part-of: --- src/gallium/drivers/r300/compiler/nir_to_rc.c | 16 ++-------------- src/gallium/drivers/r300/compiler/nir_to_rc.h | 12 +----------- src/gallium/drivers/r300/r300_state.c | 16 +--------------- 3 files changed, 4 insertions(+), 40 deletions(-) diff --git a/src/gallium/drivers/r300/compiler/nir_to_rc.c b/src/gallium/drivers/r300/compiler/nir_to_rc.c index 5e469630807..d74cdeaf6c0 100644 --- a/src/gallium/drivers/r300/compiler/nir_to_rc.c +++ b/src/gallium/drivers/r300/compiler/nir_to_rc.c @@ -52,7 +52,6 @@ struct ntr_reg_interval { struct ntr_compile { nir_shader *s; nir_function_impl *impl; - const struct nir_to_rc_options *options; struct pipe_screen *screen; struct ureg_program *ureg; @@ -2325,14 +2324,6 @@ nir_to_rc_lower_txp(nir_shader *s) NIR_PASS_V(s, nir_lower_tex, &lower_tex_options); } -const void * -nir_to_rc(struct nir_shader *s, - struct pipe_screen *screen) -{ - static const struct nir_to_rc_options default_ntr_options = {0}; - return nir_to_rc_options(s, screen, &default_ntr_options); -} - /** * Translates the NIR shader to TGSI. * @@ -2340,9 +2331,8 @@ nir_to_rc(struct nir_shader *s, * We take ownership of the NIR shader passed, returning a reference to the new * TGSI tokens instead. If you need to keep the NIR, then pass us a clone. */ -const void *nir_to_rc_options(struct nir_shader *s, - struct pipe_screen *screen, - const struct nir_to_rc_options *options) +const void *nir_to_rc(struct nir_shader *s, + struct pipe_screen *screen) { struct ntr_compile *c; const void *tgsi_tokens; @@ -2442,8 +2432,6 @@ const void *nir_to_rc_options(struct nir_shader *s, nir_print_shader(s, stderr); } - c->options = options; - c->s = s; c->ureg = ureg_create(pipe_shader_type_from_mesa(s->info.stage)); ureg_setup_shader_info(c->ureg, &s->info); diff --git a/src/gallium/drivers/r300/compiler/nir_to_rc.h b/src/gallium/drivers/r300/compiler/nir_to_rc.h index 3232b00c620..26a94ec96fa 100644 --- a/src/gallium/drivers/r300/compiler/nir_to_rc.h +++ b/src/gallium/drivers/r300/compiler/nir_to_rc.h @@ -11,18 +11,8 @@ struct nir_shader; struct pipe_screen; -struct pipe_shader_state; - -struct nir_to_rc_options { - /* Emit MAX(a,-a) instead of abs src modifier) */ - bool lower_ssbo_bindings; -}; const void *nir_to_rc(struct nir_shader *s, - struct pipe_screen *screen); - -const void *nir_to_rc_options(struct nir_shader *s, - struct pipe_screen *screen, - const struct nir_to_rc_options *ntr_options); + struct pipe_screen *screen); #endif /* NIR_TO_RC_H */ diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 8161e858023..ff28c7eb49c 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -1921,21 +1921,7 @@ static void* r300_create_vs_state(struct pipe_context* pipe, vs->state = *shader; if (vs->state.type == PIPE_SHADER_IR_NIR) { - static const struct nir_to_rc_options swtcl_options = {0}; - static const struct nir_to_rc_options hwtcl_r300_options = {0}; - static const struct nir_to_rc_options hwtcl_r500_options = {0}; - const struct nir_to_rc_options *ntr_options; - if (r300->screen->caps.has_tcl) { - if (r300->screen->caps.is_r500) { - ntr_options = &hwtcl_r500_options; - } else { - ntr_options = &hwtcl_r300_options; - } - } else { - ntr_options = &swtcl_options; - } - vs->state.tokens = nir_to_rc_options(shader->ir.nir, pipe->screen, - ntr_options); + vs->state.tokens = nir_to_rc(shader->ir.nir, pipe->screen); } else { assert(vs->state.type == PIPE_SHADER_IR_TGSI); /* we need to keep a local copy of the tokens */