This function is called just before the gl_program::driver_cache_blob
is saved out as part of the gl_program serialization.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
functions->ProgramBinarySerializeDriverBlob = brw_program_serialize_nir;
functions->ProgramBinaryDeserializeDriverBlob =
brw_deserialize_program_binary;
+
+ if (brw->screen->disk_cache) {
+ functions->ShaderCacheSerializeDriverBlob = brw_program_serialize_nir;
+ }
}
static void
}
}
- if (brw->ctx.Cache) {
- for (stage = 0; stage < ARRAY_SIZE(shProg->_LinkedShaders); stage++) {
- struct gl_linked_shader *shader = shProg->_LinkedShaders[stage];
- if (!shader)
- continue;
-
- struct gl_program *prog = shader->Program;
- brw_program_serialize_nir(ctx, prog);
- }
- }
-
if (brw->precompile && !brw_shader_precompile(ctx, shProg))
return false;
void
brw_program_serialize_nir(struct gl_context *ctx, struct gl_program *prog)
{
+ if (prog->driver_cache_blob)
+ return;
+
struct blob writer;
blob_init(&writer);
nir_serialize(&writer, prog->nir);