From 706fef711baf90cd04ca2f76eb53a730a93a518f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sat, 3 Oct 2020 04:12:47 -0400 Subject: [PATCH] gallium/u_threaded_context: always flush asynchronously if requested This can reduce overhead depending on whether st/mesa uses the ASYNC flag and the app flushes often. Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/auxiliary/util/u_threaded_context.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c index 09be4a6a657..9d22fde6c6c 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.c +++ b/src/gallium/auxiliary/util/u_threaded_context.c @@ -2055,19 +2055,7 @@ tc_flush(struct pipe_context *_pipe, struct pipe_fence_handle **fence, struct threaded_context *tc = threaded_context(_pipe); struct pipe_context *pipe = tc->pipe; struct pipe_screen *screen = pipe->screen; - bool async = flags & PIPE_FLUSH_DEFERRED; - - if (flags & PIPE_FLUSH_ASYNC) { - struct tc_batch *last = &tc->batch_slots[tc->last]; - - /* Prefer to do the flush in the driver thread, but avoid the inter-thread - * communication overhead if the driver thread is currently idle and the - * caller is going to wait for the fence immediately anyway. - */ - if (!(util_queue_fence_is_signalled(&last->fence) && - (flags & PIPE_FLUSH_HINT_FINISH))) - async = true; - } + bool async = flags & (PIPE_FLUSH_DEFERRED | PIPE_FLUSH_ASYNC); if (async && tc->create_fence) { if (fence) {