aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/shared.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/shared.c')
-rw-r--r--src/mesa/main/shared.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c
index 93bbccd3c7f..643ad3354e7 100644
--- a/src/mesa/main/shared.c
+++ b/src/mesa/main/shared.c
@@ -43,7 +43,9 @@
#if FEATURE_ATI_fragment_shader
#include "shader/atifragshader.h"
#endif
-
+#if FEATURE_ARB_sync
+#include "syncobj.h"
+#endif
/**
* Allocate and initialize a shared context state structure.
@@ -127,6 +129,10 @@ _mesa_alloc_shared_state(GLcontext *ctx)
shared->RenderBuffers = _mesa_NewHashTable();
#endif
+#if FEATURE_ARB_sync
+ make_empty_list(& shared->SyncObjects);
+#endif
+
return shared;
}
@@ -336,6 +342,17 @@ _mesa_free_shared_state(GLcontext *ctx, struct gl_shared_state *shared)
ctx->Driver.DeleteBuffer(ctx, shared->NullBufferObj);
#endif
+#if FEATURE_ARB_sync
+ {
+ struct simple_node *node;
+ struct simple_node *temp;
+
+ foreach_s(node, temp, & shared->SyncObjects) {
+ _mesa_unref_sync_object(ctx, (struct gl_sync_object *) node);
+ }
+ }
+#endif
+
/*
* Free texture objects (after FBOs since some textures might have
* been bound to FBOs).