From a2a95abb6c32529e16359dc75f77caa32df489f2 Mon Sep 17 00:00:00 2001 From: Axel Davy Date: Fri, 12 Mar 2021 21:28:39 +0100 Subject: [PATCH] st/nine: Improve performance with thread_submit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the Async flush flag to return faster during Present() when thread_submit is used. Signed-off-by: Axel Davy Acked-by: Timur Kristóf Part-of: --- src/gallium/frontends/nine/swapchain9.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/frontends/nine/swapchain9.c b/src/gallium/frontends/nine/swapchain9.c index 7c844bf50ac..1376ed99454 100644 --- a/src/gallium/frontends/nine/swapchain9.c +++ b/src/gallium/frontends/nine/swapchain9.c @@ -886,7 +886,9 @@ present( struct NineSwapChain9 *This, handle_draw_cursor_and_hud(This, resource); fence = NULL; - pipe->flush(pipe, &fence, PIPE_FLUSH_END_OF_FRAME); + /* When threadpool is enabled, we don't submit before the fence + * tells us rendering was finished, thus we can flush async there */ + pipe->flush(pipe, &fence, PIPE_FLUSH_END_OF_FRAME | (This->enable_threadpool ? PIPE_FLUSH_ASYNC : 0)); /* Present now for thread_submit, because we have the fence. * It's possible we return WASSTILLDRAWING and still Present,