<div dir="ltr"><div>Based on what you pasted on IRC the other day, I'm guessing the problem was the missing unify_interfaces(). In any case, this looks much better. The closer serialization happens to back-end shader compilation, the better.<br><br></div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 1, 2017 at 3:08 PM, Jordan Justen <span dir="ltr"><<a href="mailto:jordan.l.justen@intel.com" target="_blank">jordan.l.justen@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Fixes MESA_GLSL=cache_fb with piglit<br>
tests/spec/glsl-1.50/<wbr>execution/geometry/clip-<wbr>distance-vs-gs-out.shader_test<br>
<br>
Fixes: 0610a624a12 i965/link: Serialize program to nir after linking for shader cache<br>
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=103988" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/<wbr>show_bug.cgi?id=103988</a><br>
Signed-off-by: Jordan Justen <<a href="mailto:jordan.l.justen@intel.com">jordan.l.justen@intel.com</a>><br>
---<br>
src/mesa/drivers/dri/i965/brw_<wbr>link.cpp | 25 ++++++++++++++++---------<br>
1 file changed, 16 insertions(+), 9 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_link.cpp b/src/mesa/drivers/dri/i965/<wbr>brw_link.cpp<br>
index d18521e792d..6177c8f5ebd 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_link.cpp<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_link.cpp<br>
@@ -302,15 +302,6 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)<br>
NIR_PASS_V(prog->nir, nir_lower_atomics_to_ssbo,<br>
prog->nir->info.num_abos);<br>
<br>
- if (brw->ctx.Cache) {<br>
- struct blob writer;<br>
- blob_init(&writer);<br>
- nir_serialize(&writer, prog->nir);<br>
- prog->driver_cache_blob = ralloc_size(NULL, writer.size);<br>
- memcpy(prog->driver_cache_<wbr>blob, writer.data, writer.size);<br>
- prog->driver_cache_blob_size = writer.size;<br>
- }<br>
-<br>
infos[stage] = &prog->nir->info;<br>
<br>
update_xfb_info(prog->sh.<wbr>LinkedTransformFeedback, infos[stage]);<br>
@@ -357,6 +348,22 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)<br>
}<br>
}<br>
<br>
+ if (brw->ctx.Cache) {<br>
+ for (stage = 0; stage < ARRAY_SIZE(shProg->_<wbr>LinkedShaders); stage++) {<br>
+ struct gl_linked_shader *shader = shProg->_LinkedShaders[stage];<br>
+ if (!shader)<br>
+ continue;<br>
+<br>
+ struct gl_program *prog = shader->Program;<br>
+ struct blob writer;<br>
+ blob_init(&writer);<br>
+ nir_serialize(&writer, prog->nir);<br>
+ prog->driver_cache_blob = ralloc_size(NULL, writer.size);<br>
+ memcpy(prog->driver_cache_<wbr>blob, writer.data, writer.size);<br>
+ prog->driver_cache_blob_size = writer.size;<br>
+ }<br>
+ }<br>
+<br>
if (brw->precompile && !brw_shader_precompile(ctx, shProg))<br>
return false;<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
2.15.0<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></div></div></div></div>