From cc0d0afe3b06e628fdd5576da07c50a15f859e98 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Wed, 27 Nov 2019 11:22:11 +0100 Subject: st/mesa: add a notify_before_flush callback param to flush MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new callback is called right before the flush is done to allow users of st->flush to do some work after all the previous work has been flushed. This will be used by dri_flush in the next commit. Reviewed-by: Marek Olšák --- src/mesa/state_tracker/st_manager.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c index a194f529a29..d1c5a0b52ad 100644 --- a/src/mesa/state_tracker/st_manager.c +++ b/src/mesa/state_tracker/st_manager.c @@ -649,7 +649,9 @@ st_framebuffers_purge(struct st_context *st) static void st_context_flush(struct st_context_iface *stctxi, unsigned flags, - struct pipe_fence_handle **fence) + struct pipe_fence_handle **fence, + void (*before_flush_cb) (void*), + void* args) { struct st_context *st = (struct st_context *) stctxi; unsigned pipe_flags = 0; @@ -661,6 +663,9 @@ st_context_flush(struct st_context_iface *stctxi, unsigned flags, FLUSH_VERTICES(st->ctx, 0); FLUSH_CURRENT(st->ctx, 0); + /* Notify the caller that we're ready to flush */ + if (before_flush_cb) + before_flush_cb(args); st_flush(st, fence, pipe_flags); if ((flags & ST_FLUSH_WAIT) && fence && *fence) { -- cgit v1.2.3