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 <davyaxel0@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4993>
struct nir_shader *
tgsi_to_nir(const void *tgsi_tokens,
- struct pipe_screen *screen)
+ struct pipe_screen *screen,
+ bool allow_disk_cache)
{
struct ttn_compile *c;
struct nir_shader *s;
+ (void)allow_disk_cache;
+
c = ttn_compile_init(tgsi_tokens, NULL, screen);
s = c->build.shader;
ttn_finalize_nir(c, screen);
struct nir_shader *
tgsi_to_nir(const void *tgsi_tokens,
- struct pipe_screen *screen);
+ struct pipe_screen *screen,
+ bool allow_disk_cache);
struct nir_shader *
tgsi_to_nir_noscreen(const void *tgsi_tokens,
if (DBG_ENABLED(ETNA_DBG_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
shader->tokens = tgsi_dup_tokens(pss->tokens);
return NULL;
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_lower_io_options)0);
return NULL;
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_lower_io_options)0);
if (ir3_shader_debug & IR3_DBG_DISASM) {
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;
if (ir3_shader_debug & IR3_DBG_DISASM) {
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 nir_shader *nir;
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
nir = state->ir.nir;
else {
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;
else {
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);
s = nir_shader_clone(NULL, ir);
} else {
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;
if (cso->ir_type != PIPE_SHADER_IR_NATIVE) {
if (cso->ir_type == PIPE_SHADER_IR_TGSI) {
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 {
assert(cso->ir_type == PIPE_SHADER_IR_NIR);
sel->nir = (struct nir_shader *)cso->prog;
sel->so = state->stream_output;
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 {
assert(state->type == PIPE_SHADER_IR_NIR);
sel->nir = state->ir.nir;
tgsi_dump(ir, 0);
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;
tgsi_dump(cso->tokens, 0);
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)
fprintf(stderr, "---8<---\n\n");
}
- return tgsi_to_nir(tokens, screen);
+ return tgsi_to_nir(tokens, screen, false);
}
static void
nine_pipe_nir_shader_state_from_tgsi(struct pipe_shader_state *state, const struct tgsi_token *tgsi_tokens,
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))) {
nir_print_shader(nir, stdout);