Lines Matching refs:syncObj
83 _mesa_delete_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj) in _mesa_delete_sync_object() argument
86 free(syncObj->Label); in _mesa_delete_sync_object()
87 free(syncObj); in _mesa_delete_sync_object()
92 _mesa_fence_sync(struct gl_context *ctx, struct gl_sync_object *syncObj, in _mesa_fence_sync() argument
99 syncObj->StatusFlag = 1; in _mesa_fence_sync()
104 _mesa_check_sync(struct gl_context *ctx, struct gl_sync_object *syncObj) in _mesa_check_sync() argument
107 (void) syncObj; in _mesa_check_sync()
116 _mesa_wait_sync(struct gl_context *ctx, struct gl_sync_object *syncObj, in _mesa_wait_sync() argument
120 (void) syncObj; in _mesa_wait_sync()
181 struct gl_sync_object *syncObj = (struct gl_sync_object *) sync; in _mesa_get_and_ref_sync() local
183 if (syncObj != NULL in _mesa_get_and_ref_sync()
184 && _mesa_set_search(ctx->Shared->SyncObjects, syncObj) != NULL in _mesa_get_and_ref_sync()
185 && (syncObj->Type == GL_SYNC_FENCE) in _mesa_get_and_ref_sync()
186 && !syncObj->DeletePending) { in _mesa_get_and_ref_sync()
188 syncObj->RefCount++; in _mesa_get_and_ref_sync()
191 syncObj = NULL; in _mesa_get_and_ref_sync()
194 return syncObj; in _mesa_get_and_ref_sync()
199 _mesa_unref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj, in _mesa_unref_sync_object() argument
205 syncObj->RefCount -= amount; in _mesa_unref_sync_object()
206 if (syncObj->RefCount == 0) { in _mesa_unref_sync_object()
207 entry = _mesa_set_search(ctx->Shared->SyncObjects, syncObj); in _mesa_unref_sync_object()
212 ctx->Driver.DeleteSyncObject(ctx, syncObj); in _mesa_unref_sync_object()
233 struct gl_sync_object *syncObj; in _mesa_DeleteSync() local
245 syncObj = _mesa_get_and_ref_sync(ctx, sync, true); in _mesa_DeleteSync()
246 if (!syncObj) { in _mesa_DeleteSync()
256 syncObj->DeletePending = GL_TRUE; in _mesa_DeleteSync()
257 _mesa_unref_sync_object(ctx, syncObj, 2); in _mesa_DeleteSync()
265 struct gl_sync_object *syncObj; in _mesa_FenceSync() local
280 syncObj = ctx->Driver.NewSyncObject(ctx, GL_SYNC_FENCE); in _mesa_FenceSync()
281 if (syncObj != NULL) { in _mesa_FenceSync()
282 syncObj->Type = GL_SYNC_FENCE; in _mesa_FenceSync()
288 syncObj->Name = 1; in _mesa_FenceSync()
289 syncObj->RefCount = 1; in _mesa_FenceSync()
290 syncObj->DeletePending = GL_FALSE; in _mesa_FenceSync()
291 syncObj->SyncCondition = condition; in _mesa_FenceSync()
292 syncObj->Flags = flags; in _mesa_FenceSync()
293 syncObj->StatusFlag = 0; in _mesa_FenceSync()
295 ctx->Driver.FenceSync(ctx, syncObj, condition, flags); in _mesa_FenceSync()
298 _mesa_set_add(ctx->Shared->SyncObjects, syncObj); in _mesa_FenceSync()
301 return (GLsync) syncObj; in _mesa_FenceSync()
312 struct gl_sync_object *syncObj; in _mesa_ClientWaitSync() local
321 syncObj = _mesa_get_and_ref_sync(ctx, sync, true); in _mesa_ClientWaitSync()
322 if (!syncObj) { in _mesa_ClientWaitSync()
334 ctx->Driver.CheckSync(ctx, syncObj); in _mesa_ClientWaitSync()
335 if (syncObj->StatusFlag) { in _mesa_ClientWaitSync()
341 ctx->Driver.ClientWaitSync(ctx, syncObj, flags, timeout); in _mesa_ClientWaitSync()
343 ret = syncObj->StatusFlag ? GL_CONDITION_SATISFIED : GL_TIMEOUT_EXPIRED; in _mesa_ClientWaitSync()
347 _mesa_unref_sync_object(ctx, syncObj, 1); in _mesa_ClientWaitSync()
356 struct gl_sync_object *syncObj; in _mesa_WaitSync() local
369 syncObj = _mesa_get_and_ref_sync(ctx, sync, true); in _mesa_WaitSync()
370 if (!syncObj) { in _mesa_WaitSync()
375 ctx->Driver.ServerWaitSync(ctx, syncObj, flags, timeout); in _mesa_WaitSync()
376 _mesa_unref_sync_object(ctx, syncObj, 1); in _mesa_WaitSync()
385 struct gl_sync_object *syncObj; in _mesa_GetSynciv() local
389 syncObj = _mesa_get_and_ref_sync(ctx, sync, true); in _mesa_GetSynciv()
390 if (!syncObj) { in _mesa_GetSynciv()
397 v[0] = syncObj->Type; in _mesa_GetSynciv()
402 v[0] = syncObj->SyncCondition; in _mesa_GetSynciv()
411 ctx->Driver.CheckSync(ctx, syncObj); in _mesa_GetSynciv()
413 v[0] = (syncObj->StatusFlag) ? GL_SIGNALED : GL_UNSIGNALED; in _mesa_GetSynciv()
418 v[0] = syncObj->Flags; in _mesa_GetSynciv()
424 _mesa_unref_sync_object(ctx, syncObj, 1); in _mesa_GetSynciv()
446 _mesa_unref_sync_object(ctx, syncObj, 1); in _mesa_GetSynciv()