static void intel_gl_fence_sync(struct gl_context *ctx, struct gl_sync_object *s, GLenum condition, GLbitfield flags) { struct brw_context *brw = brw_context(ctx); struct intel_gl_sync_object *sync = (struct intel_gl_sync_object *)s; brw_fence_insert(brw, &sync->fence); }
static void brw_gl_fence_sync(struct gl_context *ctx, struct gl_sync_object *_sync, GLenum condition, GLbitfield flags) { struct brw_context *brw = brw_context(ctx); struct brw_gl_sync *sync = (struct brw_gl_sync *) _sync; brw_fence_init(brw, &sync->fence); brw_fence_insert(brw, &sync->fence); }
static void * intel_dri_create_fence(__DRIcontext *ctx) { struct brw_context *brw = ctx->driverPrivate; struct brw_fence *fence; fence = calloc(1, sizeof(*fence)); if (!fence) return NULL; brw_fence_insert(brw, fence); return fence; }
static void brw_fence_server_wait(struct brw_context *brw, struct brw_fence *fence) { switch (fence->type) { case BRW_FENCE_TYPE_BO_WAIT: /* We have nothing to do for WaitSync. Our GL command stream is sequential, * so given that the sync object has already flushed the batchbuffer, any * batchbuffers coming after this waitsync will naturally not occur until * the previous one is done. */ break; case BRW_FENCE_TYPE_SYNC_FD: assert(fence->sync_fd != -1); /* The user wants explicit synchronization, so give them what they want. */ if (!brw_fence_insert(brw, fence)) { /* FIXME: There exists no way yet to report an error here. If an error * occurs, continue silently and hope for the best. */ } break; } }