From 794f7326bcc3ffb7ab473d2c10a8c81ff4958167 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Wed, 27 Apr 2016 15:41:19 +1000 Subject: glsl: don't lose uniform values when falling back to full compile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Here we skip the recreation of uniform storage if we are relinking after a cache miss. This is improtant because uniform values may have already been set by the application and we don't want to reset them. Reviewed-by: Nicolai Hähnle --- src/mesa/main/shaderobj.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa/main/shaderobj.c') diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c index 2ca65442726..8cc90736801 100644 --- a/src/mesa/main/shaderobj.c +++ b/src/mesa/main/shaderobj.c @@ -327,7 +327,7 @@ _mesa_clear_shader_program_data(struct gl_context *ctx, shProg->data->linked_stages = 0; - if (shProg->data->UniformStorage) { + if (shProg->data->UniformStorage && !shProg->data->cache_fallback) { for (unsigned i = 0; i < shProg->data->NumUniformStorage; ++i) _mesa_uniform_detach_all_driver_storage(&shProg->data-> UniformStorage[i]); @@ -336,7 +336,7 @@ _mesa_clear_shader_program_data(struct gl_context *ctx, shProg->data->UniformStorage = NULL; } - if (shProg->UniformRemapTable) { + if (shProg->UniformRemapTable && !shProg->data->cache_fallback) { ralloc_free(shProg->UniformRemapTable); shProg->NumUniformRemapTable = 0; shProg->UniformRemapTable = NULL; -- cgit v1.2.3