[Mesa-dev] [PATCH 2/2] st/mesa: finalise tcs/tes/geom NIR before storing it to the cache

Marek Olšák maraeo at gmail.com
Mon Apr 9 20:55:11 UTC 2018


For the series:

Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Thu, Apr 5, 2018 at 3:37 AM, Timothy Arceri <tarceri at itsqueeze.com>
wrote:

> We don't create variants of the NIR so here we finalise it before
> caching to avoid unnecessary processing when restoring it.
> ---
>  src/mesa/state_tracker/st_program.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_program.c
> b/src/mesa/state_tracker/st_program.c
> index a740c874c9e..3f8df31da18 100644
> --- a/src/mesa/state_tracker/st_program.c
> +++ b/src/mesa/state_tracker/st_program.c
> @@ -1473,6 +1473,9 @@ st_translate_geometry_program(struct st_context *st,
>
>     /* We have already compiled to NIR so just return */
>     if (stgp->shader_program) {
> +      /* No variants */
> +      st_finalize_nir(st, &stgp->Base, stgp->shader_program,
> +                      stgp->tgsi.ir.nir);
>        st_translate_program_stream_output(&stgp->Base,
> &stgp->tgsi.stream_output);
>        st_store_ir_in_disk_cache(st, &stgp->Base, true);
>        return true;
> @@ -1530,8 +1533,6 @@ st_get_basic_variant(struct st_context *st,
>          if (prog->tgsi.type == PIPE_SHADER_IR_NIR) {
>             tgsi.type = PIPE_SHADER_IR_NIR;
>             tgsi.ir.nir = nir_shader_clone(NULL, prog->tgsi.ir.nir);
> -           st_finalize_nir(st, &prog->Base, prog->shader_program,
> -                            tgsi.ir.nir);
>              tgsi.stream_output = prog->tgsi.stream_output;
>          } else
>             tgsi = prog->tgsi;
> @@ -1575,6 +1576,9 @@ st_translate_tessctrl_program(struct st_context *st,
>
>     /* We have already compiled to NIR so just return */
>     if (sttcp->shader_program) {
> +      /* No variants */
> +      st_finalize_nir(st, &sttcp->Base, sttcp->shader_program,
> +                      sttcp->tgsi.ir.nir);
>        st_store_ir_in_disk_cache(st, &sttcp->Base, true);
>        return true;
>     }
> @@ -1606,6 +1610,9 @@ st_translate_tesseval_program(struct st_context *st,
>
>     /* We have already compiled to NIR so just return */
>     if (sttep->shader_program) {
> +      /* No variants */
> +      st_finalize_nir(st, &sttep->Base, sttep->shader_program,
> +                      sttep->tgsi.ir.nir);
>        st_translate_program_stream_output(&sttep->Base,
> &sttep->tgsi.stream_output);
>        st_store_ir_in_disk_cache(st, &sttep->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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180409/4264f12d/attachment.html>


More information about the mesa-dev mailing list