mesa/st: split out builtin shader finish

it's useful to be able to run the nir passes separately

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18198>
This commit is contained in:
Mike Blumenkrantz 2022-08-12 12:21:08 -04:00 committed by Marge Bot
parent 95cea62a9b
commit e7f2f050c4
2 changed files with 11 additions and 3 deletions

View file

@ -59,6 +59,8 @@ void st_nir_lower_samplers(struct pipe_screen *screen, struct nir_shader *nir,
struct gl_program *prog);
void st_nir_lower_uniforms(struct st_context *st, struct nir_shader *nir);
void
st_nir_finish_builtin_nir(struct st_context *st, struct nir_shader *nir);
struct pipe_shader_state *
st_nir_finish_builtin_shader(struct st_context *st,
struct nir_shader *nir);

View file

@ -29,9 +29,8 @@
#include "compiler/glsl/gl_nir_linker.h"
#include "tgsi/tgsi_parse.h"
struct pipe_shader_state *
st_nir_finish_builtin_shader(struct st_context *st,
nir_shader *nir)
void
st_nir_finish_builtin_nir(struct st_context *st, nir_shader *nir)
{
struct pipe_screen *screen = st->screen;
gl_shader_stage stage = nir->info.stage;
@ -75,6 +74,13 @@ st_nir_finish_builtin_shader(struct st_context *st,
} else {
gl_nir_opts(nir);
}
}
struct pipe_shader_state *
st_nir_finish_builtin_shader(struct st_context *st,
nir_shader *nir)
{
st_nir_finish_builtin_nir(st, nir);
struct pipe_shader_state state = {
.type = PIPE_SHADER_IR_NIR,