mesa/glsl: add cache_fallback flag to gl_shader_program_data
authorTimothy Arceri <timothy.arceri@collabora.com>
Sun, 20 Nov 2016 01:47:00 +0000 (12:47 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Fri, 17 Feb 2017 00:18:43 +0000 (11:18 +1100)
This will allow us to skip certain things when falling back to
a full recompile on a cache miss such as avoiding reinitialising
uniforms.

In this change we use it to avoid reading the program metadata
from the cache and skipping linking during a fallback.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/compiler/glsl/shader_cache.cpp
src/mesa/main/mtypes.h

index 3bfcab9..499470b 100644 (file)
@@ -1281,7 +1281,7 @@ shader_cache_read_program_metadata(struct gl_context *ctx,
       return false;
 
    struct disk_cache *cache = ctx->Cache;
-   if (!cache)
+   if (!cache || prog->data->cache_fallback)
       return false;
 
    /* Include bindings when creating sha1. These bindings change the resulting
index e24ee3c..12d68ab 100644 (file)
@@ -2686,6 +2686,8 @@ struct gl_shader_program_data
    unsigned NumUniformDataSlots;
    union gl_constant_value *UniformDataSlots;
 
+   bool cache_fallback;
+
    /** List of all active resources after linking. */
    struct gl_program_resource *ProgramResourceList;
    unsigned NumProgramResourceList;