ctx->base.draw_vbo = zink_draw_vbo;
ctx->base.launch_grid = zink_launch_grid;
+ ctx->base.fence_server_sync = zink_fence_server_sync;
ctx->base.flush = zink_flush;
ctx->base.memory_barrier = zink_memory_barrier;
ctx->base.texture_barrier = zink_texture_barrier;
}
void
+zink_fence_server_sync(struct pipe_context *pctx, struct pipe_fence_handle *pfence)
+{
+ struct zink_fence *fence = zink_fence(pfence);
+
+ if (pctx && fence->deferred_ctx == pctx)
+ return;
+
+ if (fence->deferred_ctx) {
+ zink_curr_batch(zink_context(pctx))->has_work = true;
+ /* this must be the current batch */
+ pctx->flush(pctx, NULL, 0);
+ }
+ zink_fence_finish(zink_screen(pctx->screen), pctx, fence, PIPE_TIMEOUT_INFINITE);
+}
+
+void
zink_screen_fence_init(struct pipe_screen *pscreen)
{
pscreen->fence_reference = fence_reference;