st/mesa: call pipe_screen::finalize_nir outside of st_finalize_nir

This is easier to read.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32175>
This commit is contained in:
Marek Olšák
2024-11-06 12:48:41 -05:00
committed by Marge Bot
parent 7717e458f1
commit b8ee69f7fe
3 changed files with 26 additions and 27 deletions

View File

@@ -397,9 +397,12 @@ st_prog_to_nir_postprocess(struct st_context *st, nir_shader *nir,
if (st->allow_st_finalize_nir_twice) {
st_serialize_base_nir(prog, nir);
st_finalize_nir(st, prog, NULL, nir, true, false);
char *msg = st_finalize_nir(st, prog, NULL, nir, true, true, false);
free(msg);
if (screen->finalize_nir) {
char *msg = screen->finalize_nir(screen, nir);
free(msg);
}
}
nir_validate_shader(nir, "after st/glsl finalize_nir");
@@ -772,9 +775,14 @@ st_create_common_variant(struct st_context *st,
}
if (finalize || !st->allow_st_finalize_nir_twice || key->is_draw_shader) {
char *msg = st_finalize_nir(st, prog, prog->shader_program, state.ir.nir,
true, false, key->is_draw_shader);
free(msg);
st_finalize_nir(st, prog, prog->shader_program, state.ir.nir, false,
key->is_draw_shader);
struct pipe_screen *screen = st->screen;
if (!key->is_draw_shader && screen->finalize_nir) {
char *msg = screen->finalize_nir(screen, state.ir.nir);
free(msg);
}
/* Clip lowering and edgeflags may have introduced new varyings, so
* update the inputs_read/outputs_written. However, with
@@ -1109,11 +1117,8 @@ st_create_fp_variant(struct st_context *st,
need_lower_tex_src_plane = true;
}
if (finalize || !st->allow_st_finalize_nir_twice) {
char *msg = st_finalize_nir(st, fp, fp->shader_program, state.ir.nir,
false, false, false);
free(msg);
}
if (finalize || !st->allow_st_finalize_nir_twice)
st_finalize_nir(st, fp, fp->shader_program, state.ir.nir, false, false);
/* This pass needs to happen *after* nir_lower_sampler */
if (unlikely(need_lower_tex_src_plane)) {