mesa/glsl: add cache_fallback flag to gl_shader_program_data

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>
This commit is contained in:
Timothy Arceri
2016-11-20 12:47:00 +11:00
committed by Timothy Arceri
parent e3adde023b
commit 2f19accc5e
2 changed files with 3 additions and 1 deletions

View File

@@ -1281,7 +1281,7 @@ shader_cache_read_program_metadata(struct gl_context *ctx,
return false; return false;
struct disk_cache *cache = ctx->Cache; struct disk_cache *cache = ctx->Cache;
if (!cache) if (!cache || prog->data->cache_fallback)
return false; return false;
/* Include bindings when creating sha1. These bindings change the resulting /* Include bindings when creating sha1. These bindings change the resulting

View File

@@ -2686,6 +2686,8 @@ struct gl_shader_program_data
unsigned NumUniformDataSlots; unsigned NumUniformDataSlots;
union gl_constant_value *UniformDataSlots; union gl_constant_value *UniformDataSlots;
bool cache_fallback;
/** List of all active resources after linking. */ /** List of all active resources after linking. */
struct gl_program_resource *ProgramResourceList; struct gl_program_resource *ProgramResourceList;
unsigned NumProgramResourceList; unsigned NumProgramResourceList;