From: Timothy Arceri Date: Tue, 23 Jan 2018 05:00:31 +0000 (+1100) Subject: st/radeonsi: enable disk cache for nir X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8f378c116eb226e18193583dcbf1a5a77246b507;p=mesa.git st/radeonsi: enable disk cache for nir Reviewed-by: Marek Olšák --- diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 97f11ea6879..31805574842 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -619,10 +619,6 @@ static void si_disk_cache_create(struct si_screen *sscreen) if (sscreen->debug_flags & DBG_ALL_SHADERS) return; - /* TODO: remove this once gallium supports a nir cache */ - if (sscreen->debug_flags & DBG(NIR)) - return; - uint32_t mesa_timestamp; if (disk_cache_get_function_timestamp(si_disk_cache_create, &mesa_timestamp)) { diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 191567ceec5..d9b7155a912 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -465,6 +465,7 @@ st_translate_vertex_program(struct st_context *st, &stvp->tgsi.stream_output); } + st_store_ir_in_disk_cache(st, &stvp->Base, true); return true; } @@ -899,9 +900,11 @@ st_translate_fragment_program(struct st_context *st, } } - /* We have already compiler to NIR so just return */ - if (stfp->shader_program) + /* We have already compiled to NIR so just return */ + if (stfp->shader_program) { + st_store_ir_in_disk_cache(st, &stfp->Base, true); return true; + } ureg = ureg_create_with_screen(PIPE_SHADER_FRAGMENT, st->pipe->screen); if (ureg == NULL) @@ -1471,6 +1474,7 @@ st_translate_geometry_program(struct st_context *st, /* We have already compiled to NIR so just return */ if (stgp->shader_program) { st_translate_program_stream_output(&stgp->Base, &stgp->tgsi.stream_output); + st_store_ir_in_disk_cache(st, &stgp->Base, true); return true; } @@ -1570,8 +1574,10 @@ st_translate_tessctrl_program(struct st_context *st, struct ureg_program *ureg; /* We have already compiled to NIR so just return */ - if (sttcp->shader_program) + if (sttcp->shader_program) { + st_store_ir_in_disk_cache(st, &sttcp->Base, true); return true; + } ureg = ureg_create_with_screen(PIPE_SHADER_TESS_CTRL, st->pipe->screen); if (ureg == NULL) @@ -1601,6 +1607,7 @@ st_translate_tesseval_program(struct st_context *st, /* We have already compiled to NIR so just return */ if (sttep->shader_program) { st_translate_program_stream_output(&sttep->Base, &sttep->tgsi.stream_output); + st_store_ir_in_disk_cache(st, &sttep->Base, true); return true; } @@ -1651,7 +1658,7 @@ st_translate_compute_program(struct st_context *st, /* no compute variants: */ st_finalize_nir(st, &stcp->Base, stcp->shader_program, (struct nir_shader *) stcp->tgsi.prog); - + st_store_ir_in_disk_cache(st, &stcp->Base, true); return true; }