summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/shaderobj.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/shaderobj.c')
-rw-r--r--src/mesa/main/shaderobj.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
index 8cc90736801..1ed19a683a3 100644
--- a/src/mesa/main/shaderobj.c
+++ b/src/mesa/main/shaderobj.c
@@ -359,9 +359,11 @@ _mesa_clear_shader_program_data(struct gl_context *ctx,
shProg->data->ShaderStorageBlocks = NULL;
shProg->data->NumShaderStorageBlocks = 0;
- ralloc_free(shProg->data->AtomicBuffers);
- shProg->data->AtomicBuffers = NULL;
- shProg->data->NumAtomicBuffers = 0;
+ if (shProg->data->AtomicBuffers && !shProg->data->cache_fallback) {
+ ralloc_free(shProg->data->AtomicBuffers);
+ shProg->data->AtomicBuffers = NULL;
+ shProg->data->NumAtomicBuffers = 0;
+ }
if (shProg->data->ProgramResourceList) {
ralloc_free(shProg->data->ProgramResourceList);