[Mesa-dev] [PATCH 3/3] st/radeonsi: enable disk cache for nir
Marek Olšák
maraeo at gmail.com
Mon Jan 29 22:02:06 UTC 2018
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Marek
On Wed, Jan 24, 2018 at 1:41 AM, Timothy Arceri <tarceri at itsqueeze.com> wrote:
> ---
> src/gallium/drivers/radeonsi/si_pipe.c | 4 ----
> src/mesa/state_tracker/st_program.c | 15 +++++++++++----
> 2 files changed, 11 insertions(+), 8 deletions(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
> index 676d199618..c096165b03 100644
> --- a/src/gallium/drivers/radeonsi/si_pipe.c
> +++ b/src/gallium/drivers/radeonsi/si_pipe.c
> @@ -621,10 +621,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 de9c5d1654..b3926eaa02 100644
> --- a/src/mesa/state_tracker/st_program.c
> +++ b/src/mesa/state_tracker/st_program.c
> @@ -466,6 +466,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;
> }
>
> @@ -900,9 +901,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)
> @@ -1472,6 +1475,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;
> }
>
> @@ -1571,8 +1575,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)
> @@ -1602,6 +1608,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;
> }
>
> @@ -1652,7 +1659,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;
> }
>
> --
> 2.14.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list