<div dir="ltr"><div><div>For the series:<br><br></div>Reviewed-by: Marek Olšák <<a href="mailto:marek.olsak@amd.com">marek.olsak@amd.com</a>><br><br></div>Marek<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 5, 2018 at 3:37 AM, Timothy Arceri <span dir="ltr"><<a href="mailto:tarceri@itsqueeze.com" target="_blank">tarceri@itsqueeze.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We don't create variants of the NIR so here we finalise it before<br>
caching to avoid unnecessary processing when restoring it.<br>
---<br>
 src/mesa/state_tracker/st_<wbr>program.c | 11 +++++++++--<br>
 1 file changed, 9 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/mesa/state_tracker/st_<wbr>program.c b/src/mesa/state_tracker/st_<wbr>program.c<br>
index a740c874c9e..3f8df31da18 100644<br>
--- a/src/mesa/state_tracker/st_<wbr>program.c<br>
+++ b/src/mesa/state_tracker/st_<wbr>program.c<br>
@@ -1473,6 +1473,9 @@ st_translate_geometry_program(<wbr>struct st_context *st,<br>
<br>
    /* We have already compiled to NIR so just return */<br>
    if (stgp->shader_program) {<br>
+      /* No variants */<br>
+      st_finalize_nir(st, &stgp->Base, stgp->shader_program,<br>
+                      stgp->tgsi.ir.nir);<br>
       st_translate_program_stream_<wbr>output(&stgp->Base, &stgp->tgsi.stream_output);<br>
       st_store_ir_in_disk_cache(st, &stgp->Base, true);<br>
       return true;<br>
@@ -1530,8 +1533,6 @@ st_get_basic_variant(struct st_context *st,<br>
         if (prog->tgsi.type == PIPE_SHADER_IR_NIR) {<br>
            tgsi.type = PIPE_SHADER_IR_NIR;<br>
            tgsi.ir.nir = nir_shader_clone(NULL, prog->tgsi.ir.nir);<br>
-           st_finalize_nir(st, &prog->Base, prog->shader_program,<br>
-                            tgsi.ir.nir);<br>
             tgsi.stream_output = prog->tgsi.stream_output;<br>
         } else<br>
            tgsi = prog->tgsi;<br>
@@ -1575,6 +1576,9 @@ st_translate_tessctrl_program(<wbr>struct st_context *st,<br>
<br>
    /* We have already compiled to NIR so just return */<br>
    if (sttcp->shader_program) {<br>
+      /* No variants */<br>
+      st_finalize_nir(st, &sttcp->Base, sttcp->shader_program,<br>
+                      sttcp->tgsi.ir.nir);<br>
       st_store_ir_in_disk_cache(st, &sttcp->Base, true);<br>
       return true;<br>
    }<br>
@@ -1606,6 +1610,9 @@ st_translate_tesseval_program(<wbr>struct st_context *st,<br>
<br>
    /* We have already compiled to NIR so just return */<br>
    if (sttep->shader_program) {<br>
+      /* No variants */<br>
+      st_finalize_nir(st, &sttep->Base, sttep->shader_program,<br>
+                      sttep->tgsi.ir.nir);<br>
       st_translate_program_stream_<wbr>output(&sttep->Base, &sttep->tgsi.stream_output);<br>
       st_store_ir_in_disk_cache(st, &sttep->Base, true);<br>
       return true;<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.14.3<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>