i965: Allow disk shader cache usage with LINKING_SUCCESS status
authorJordan Justen <jordan.l.justen@intel.com>
Tue, 13 Mar 2018 19:14:23 +0000 (12:14 -0700)
committerJordan Justen <jordan.l.justen@intel.com>
Mon, 19 Mar 2018 16:57:09 +0000 (09:57 -0700)
Currently, we only look in the disk shader cache if we see that the
shader program is in the cache during the link step.

If the shader cache entry isn't found during the program link, there
are still some (fairly unlikely) scenarios where later it might be
useful to search the cache for gen binary programs.

1. If the cache evicts the serialized glsl cache, there might still be
   valid gen program entries in the disk cache.

2. If two applications are running in parallel, then it is possible
   that one may write out the cached gen program item which the other
   application can then make use of.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mesa/drivers/dri/i965/brw_disk_cache.c

index c77e921b6a726e95c5f50a480659438b648f4567..ee6067ca51a0fdd4620432ecbeb296640651a269 100644 (file)
@@ -283,9 +283,6 @@ brw_disk_cache_upload_program(struct brw_context *brw, gl_shader_stage stage)
    if (brw->ctx._Shader->Flags & GLSL_CACHE_FALLBACK)
       goto fail;
 
-   if (prog->sh.data->LinkStatus != LINKING_SKIPPED)
-      goto fail;
-
    if (!read_and_upload(brw, cache, prog, stage))
       goto fail;