mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-30 00:40:25 +01:00
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 <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6952>
This commit is contained in:
parent
28256d3d7b
commit
706fef711b
1 changed files with 1 additions and 13 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue