glsl: don't reprocess or clear UBOs on cache fallback
[mesa.git] / src / mesa / main / shaderobj.c
index 1ed19a683a3adeb09ce76b24e9c92c07fa14af1a..8a5fa5e2dfcfa56d835592d755a0edd4e3a6718f 100644 (file)
@@ -351,13 +351,15 @@ _mesa_clear_shader_program_data(struct gl_context *ctx,
    ralloc_free(shProg->data->InfoLog);
    shProg->data->InfoLog = ralloc_strdup(shProg->data, "");
 
-   ralloc_free(shProg->data->UniformBlocks);
-   shProg->data->UniformBlocks = NULL;
-   shProg->data->NumUniformBlocks = 0;
-
-   ralloc_free(shProg->data->ShaderStorageBlocks);
-   shProg->data->ShaderStorageBlocks = NULL;
-   shProg->data->NumShaderStorageBlocks = 0;
+   if (!shProg->data->cache_fallback) {
+      ralloc_free(shProg->data->UniformBlocks);
+      shProg->data->UniformBlocks = NULL;
+      shProg->data->NumUniformBlocks = 0;
+
+      ralloc_free(shProg->data->ShaderStorageBlocks);
+      shProg->data->ShaderStorageBlocks = NULL;
+      shProg->data->NumShaderStorageBlocks = 0;
+   }
 
    if (shProg->data->AtomicBuffers && !shProg->data->cache_fallback) {
       ralloc_free(shProg->data->AtomicBuffers);