}
-void GLAPIENTRY
-_mesa_DeleteSync(GLsync sync)
+static ALWAYS_INLINE void
+delete_sync(struct gl_context *ctx, GLsync sync, bool no_error)
{
- GET_CURRENT_CONTEXT(ctx);
struct gl_sync_object *syncObj;
/* From the GL_ARB_sync spec:
}
syncObj = _mesa_get_and_ref_sync(ctx, sync, true);
- if (!syncObj) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteSync (not a valid sync object)");
+ if (!no_error && !syncObj) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glDeleteSync (not a valid sync object)");
return;
}
/* If there are no client-waits or server-waits pending on this sync, delete
* the underlying object. Note that we double-unref the object, as
- * _mesa_get_and_ref_sync above took an extra refcount to make sure the pointer
- * is valid for us to manipulate.
+ * _mesa_get_and_ref_sync above took an extra refcount to make sure the
+ * pointer is valid for us to manipulate.
*/
syncObj->DeletePending = GL_TRUE;
_mesa_unref_sync_object(ctx, syncObj, 2);
}
+void GLAPIENTRY
+_mesa_DeleteSync(GLsync sync)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ delete_sync(ctx, sync, false);
+}
+
+
static GLsync
fence_sync(struct gl_context *ctx, GLenum condition, GLbitfield flags)
{