r300: remove nir_to_rc_options wrapper

Just call nir_to_rc directly since we don't have any options anymore.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28663>
This commit is contained in:
Pavel Ondračka 2024-04-09 22:09:55 +02:00 committed by Marge Bot
parent b1c98ffd9e
commit 9dc6ea2fad
3 changed files with 4 additions and 40 deletions

View file

@ -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);

View file

@ -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 */

View file

@ -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 */