Commit 522bd414 authored by Axel Davy's avatar Axel Davy Committed by Marge Bot

ttn: Add new allow_disk_cache parameter

For now this parameter doesn't do anything.
It means the implementation is allowed to use
a cache on disk.
Signed-off-by: Axel Davy's avatarAxel Davy <davyaxel0@gmail.com>
Reviewed-by: default avatarMarek Olšák <marek.olsak@amd.com>
Part-of: <!4993>
parent 6670475a
...@@ -2582,11 +2582,14 @@ ttn_finalize_nir(struct ttn_compile *c, struct pipe_screen *screen) ...@@ -2582,11 +2582,14 @@ ttn_finalize_nir(struct ttn_compile *c, struct pipe_screen *screen)
struct nir_shader * struct nir_shader *
tgsi_to_nir(const void *tgsi_tokens, tgsi_to_nir(const void *tgsi_tokens,
struct pipe_screen *screen) struct pipe_screen *screen,
bool allow_disk_cache)
{ {
struct ttn_compile *c; struct ttn_compile *c;
struct nir_shader *s; struct nir_shader *s;
(void)allow_disk_cache;
c = ttn_compile_init(tgsi_tokens, NULL, screen); c = ttn_compile_init(tgsi_tokens, NULL, screen);
s = c->build.shader; s = c->build.shader;
ttn_finalize_nir(c, screen); ttn_finalize_nir(c, screen);
......
...@@ -29,7 +29,8 @@ ...@@ -29,7 +29,8 @@
struct nir_shader * struct nir_shader *
tgsi_to_nir(const void *tgsi_tokens, tgsi_to_nir(const void *tgsi_tokens,
struct pipe_screen *screen); struct pipe_screen *screen,
bool allow_disk_cache);
struct nir_shader * struct nir_shader *
tgsi_to_nir_noscreen(const void *tgsi_tokens, tgsi_to_nir_noscreen(const void *tgsi_tokens,
......
...@@ -406,7 +406,7 @@ etna_create_shader_state(struct pipe_context *pctx, ...@@ -406,7 +406,7 @@ etna_create_shader_state(struct pipe_context *pctx,
if (DBG_ENABLED(ETNA_DBG_NIR)) if (DBG_ENABLED(ETNA_DBG_NIR))
shader->nir = (pss->type == PIPE_SHADER_IR_NIR) ? pss->ir.nir : shader->nir = (pss->type == PIPE_SHADER_IR_NIR) ? pss->ir.nir :
tgsi_to_nir(pss->tokens, pctx->screen); tgsi_to_nir(pss->tokens, pctx->screen, false);
else else
shader->tokens = tgsi_dup_tokens(pss->tokens); shader->tokens = tgsi_dup_tokens(pss->tokens);
......
...@@ -98,7 +98,7 @@ fd2_fp_state_create(struct pipe_context *pctx, ...@@ -98,7 +98,7 @@ fd2_fp_state_create(struct pipe_context *pctx,
return NULL; return NULL;
so->nir = (cso->type == PIPE_SHADER_IR_NIR) ? cso->ir.nir : so->nir = (cso->type == PIPE_SHADER_IR_NIR) ? cso->ir.nir :
tgsi_to_nir(cso->tokens, pctx->screen); tgsi_to_nir(cso->tokens, pctx->screen, false);
NIR_PASS_V(so->nir, nir_lower_io, nir_var_all, ir2_glsl_type_size, NIR_PASS_V(so->nir, nir_lower_io, nir_var_all, ir2_glsl_type_size,
(nir_lower_io_options)0); (nir_lower_io_options)0);
...@@ -135,7 +135,7 @@ fd2_vp_state_create(struct pipe_context *pctx, ...@@ -135,7 +135,7 @@ fd2_vp_state_create(struct pipe_context *pctx,
return NULL; return NULL;
so->nir = (cso->type == PIPE_SHADER_IR_NIR) ? cso->ir.nir : so->nir = (cso->type == PIPE_SHADER_IR_NIR) ? cso->ir.nir :
tgsi_to_nir(cso->tokens, pctx->screen); tgsi_to_nir(cso->tokens, pctx->screen, false);
NIR_PASS_V(so->nir, nir_lower_io, nir_var_all, ir2_glsl_type_size, NIR_PASS_V(so->nir, nir_lower_io, nir_var_all, ir2_glsl_type_size,
(nir_lower_io_options)0); (nir_lower_io_options)0);
......
...@@ -139,7 +139,7 @@ ir3_shader_create(struct ir3_compiler *compiler, ...@@ -139,7 +139,7 @@ ir3_shader_create(struct ir3_compiler *compiler,
if (ir3_shader_debug & IR3_DBG_DISASM) { if (ir3_shader_debug & IR3_DBG_DISASM) {
tgsi_dump(cso->tokens, 0); tgsi_dump(cso->tokens, 0);
} }
nir = tgsi_to_nir(cso->tokens, screen); nir = tgsi_to_nir(cso->tokens, screen, false);
} }
struct ir3_stream_output_info stream_output; struct ir3_stream_output_info stream_output;
...@@ -208,7 +208,7 @@ ir3_shader_create_compute(struct ir3_compiler *compiler, ...@@ -208,7 +208,7 @@ ir3_shader_create_compute(struct ir3_compiler *compiler,
if (ir3_shader_debug & IR3_DBG_DISASM) { if (ir3_shader_debug & IR3_DBG_DISASM) {
tgsi_dump(cso->prog, 0); tgsi_dump(cso->prog, 0);
} }
nir = tgsi_to_nir(cso->prog, screen); nir = tgsi_to_nir(cso->prog, screen, false);
} }
struct ir3_shader *shader = ir3_shader_from_nir(compiler, nir, NULL); struct ir3_shader *shader = ir3_shader_from_nir(compiler, nir, NULL);
......
...@@ -2217,7 +2217,7 @@ iris_create_shader_state(struct pipe_context *ctx, ...@@ -2217,7 +2217,7 @@ iris_create_shader_state(struct pipe_context *ctx,
struct nir_shader *nir; struct nir_shader *nir;
if (state->type == PIPE_SHADER_IR_TGSI) if (state->type == PIPE_SHADER_IR_TGSI)
nir = tgsi_to_nir(state->tokens, ctx->screen); nir = tgsi_to_nir(state->tokens, ctx->screen, false);
else else
nir = state->ir.nir; nir = state->ir.nir;
......
...@@ -298,7 +298,7 @@ lima_create_fs_state(struct pipe_context *pctx, ...@@ -298,7 +298,7 @@ lima_create_fs_state(struct pipe_context *pctx,
else { else {
assert(cso->type == PIPE_SHADER_IR_TGSI); assert(cso->type == PIPE_SHADER_IR_TGSI);
nir = tgsi_to_nir(cso->tokens, pctx->screen); nir = tgsi_to_nir(cso->tokens, pctx->screen, false);
} }
so->base.type = PIPE_SHADER_IR_NIR; so->base.type = PIPE_SHADER_IR_NIR;
...@@ -454,7 +454,7 @@ lima_create_vs_state(struct pipe_context *pctx, ...@@ -454,7 +454,7 @@ lima_create_vs_state(struct pipe_context *pctx,
else { else {
assert(cso->type == PIPE_SHADER_IR_TGSI); assert(cso->type == PIPE_SHADER_IR_TGSI);
nir = tgsi_to_nir(cso->tokens, pctx->screen); nir = tgsi_to_nir(cso->tokens, pctx->screen, false);
} }
lima_program_optimize_vs_nir(nir); lima_program_optimize_vs_nir(nir);
......
...@@ -132,7 +132,7 @@ panfrost_shader_compile(struct panfrost_context *ctx, ...@@ -132,7 +132,7 @@ panfrost_shader_compile(struct panfrost_context *ctx,
s = nir_shader_clone(NULL, ir); s = nir_shader_clone(NULL, ir);
} else { } else {
assert (ir_type == PIPE_SHADER_IR_TGSI); assert (ir_type == PIPE_SHADER_IR_TGSI);
s = tgsi_to_nir(ir, ctx->base.screen); s = tgsi_to_nir(ir, ctx->base.screen, false);
} }
s->info.stage = stage; s->info.stage = stage;
......
...@@ -217,7 +217,7 @@ static void *si_create_compute_state(struct pipe_context *ctx, const struct pipe ...@@ -217,7 +217,7 @@ static void *si_create_compute_state(struct pipe_context *ctx, const struct pipe
if (cso->ir_type != PIPE_SHADER_IR_NATIVE) { if (cso->ir_type != PIPE_SHADER_IR_NATIVE) {
if (cso->ir_type == PIPE_SHADER_IR_TGSI) { if (cso->ir_type == PIPE_SHADER_IR_TGSI) {
program->ir_type = PIPE_SHADER_IR_NIR; program->ir_type = PIPE_SHADER_IR_NIR;
sel->nir = tgsi_to_nir(cso->prog, ctx->screen); sel->nir = tgsi_to_nir(cso->prog, ctx->screen, false);
} else { } else {
assert(cso->ir_type == PIPE_SHADER_IR_NIR); assert(cso->ir_type == PIPE_SHADER_IR_NIR);
sel->nir = (struct nir_shader *)cso->prog; sel->nir = (struct nir_shader *)cso->prog;
......
...@@ -2593,7 +2593,7 @@ static void *si_create_shader_selector(struct pipe_context *ctx, ...@@ -2593,7 +2593,7 @@ static void *si_create_shader_selector(struct pipe_context *ctx,
sel->so = state->stream_output; sel->so = state->stream_output;
if (state->type == PIPE_SHADER_IR_TGSI) { if (state->type == PIPE_SHADER_IR_TGSI) {
sel->nir = tgsi_to_nir(state->tokens, ctx->screen); sel->nir = tgsi_to_nir(state->tokens, ctx->screen, false);
} else { } else {
assert(state->type == PIPE_SHADER_IR_NIR); assert(state->type == PIPE_SHADER_IR_NIR);
sel->nir = state->ir.nir; sel->nir = state->ir.nir;
......
...@@ -303,7 +303,7 @@ v3d_uncompiled_shader_create(struct pipe_context *pctx, ...@@ -303,7 +303,7 @@ v3d_uncompiled_shader_create(struct pipe_context *pctx,
tgsi_dump(ir, 0); tgsi_dump(ir, 0);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
} }
s = tgsi_to_nir(ir, pctx->screen); s = tgsi_to_nir(ir, pctx->screen, false);
} }
nir_variable_mode lower_mode = nir_var_all & ~nir_var_uniform; nir_variable_mode lower_mode = nir_var_all & ~nir_var_uniform;
......
...@@ -2466,7 +2466,7 @@ vc4_shader_state_create(struct pipe_context *pctx, ...@@ -2466,7 +2466,7 @@ vc4_shader_state_create(struct pipe_context *pctx,
tgsi_dump(cso->tokens, 0); tgsi_dump(cso->tokens, 0);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
} }
s = tgsi_to_nir(cso->tokens, pctx->screen); s = tgsi_to_nir(cso->tokens, pctx->screen, false);
} }
if (s->info.stage == MESA_SHADER_VERTEX) if (s->info.stage == MESA_SHADER_VERTEX)
......
...@@ -108,7 +108,7 @@ zink_tgsi_to_nir(struct pipe_screen *screen, const struct tgsi_token *tokens) ...@@ -108,7 +108,7 @@ zink_tgsi_to_nir(struct pipe_screen *screen, const struct tgsi_token *tokens)
fprintf(stderr, "---8<---\n\n"); fprintf(stderr, "---8<---\n\n");
} }
return tgsi_to_nir(tokens, screen); return tgsi_to_nir(tokens, screen, false);
} }
static void static void
......
...@@ -3836,7 +3836,7 @@ static void ...@@ -3836,7 +3836,7 @@ static void
nine_pipe_nir_shader_state_from_tgsi(struct pipe_shader_state *state, const struct tgsi_token *tgsi_tokens, nine_pipe_nir_shader_state_from_tgsi(struct pipe_shader_state *state, const struct tgsi_token *tgsi_tokens,
struct pipe_screen *screen) struct pipe_screen *screen)
{ {
struct nir_shader *nir = tgsi_to_nir(tgsi_tokens, screen); struct nir_shader *nir = tgsi_to_nir(tgsi_tokens, screen, false);
if (unlikely(nine_shader_get_debug_flag(NINE_SHADER_DEBUG_OPTION_DUMP_NIR))) { if (unlikely(nine_shader_get_debug_flag(NINE_SHADER_DEBUG_OPTION_DUMP_NIR))) {
nir_print_shader(nir, stdout); nir_print_shader(nir, stdout);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment