Module: Mesa
Branch: main
Commit: 849ab4ea0caf9e2ce3d4bb5d2f1308edff9913fd
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=849ab4ea0caf9e2ce3d4bb5d2f1308edff9913fd

Author: Marek Olšák <[email protected]>
Date:   Fri May 21 17:52:27 2021 -0400

mesa: execute glFlush asynchronously if no image has been imported/exported

This improves viewperf performance and it shouldn't break synchronization
with external clients when it's indirectly implied by glFlush.

This should not break the cases described in:
    https://gitlab.freedesktop.org/mesa/mesa/-/issues/4903

Acked-By: Mike Blumenkrantz <[email protected]>
Reviewed-by: Adam Jackson <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11341>

---

 src/mesa/main/context.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index d83fab6954f..b94a6d272d2 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1772,7 +1772,9 @@ _mesa_flush(struct gl_context *ctx)
 {
    FLUSH_VERTICES(ctx, 0, 0);
    if (ctx->Driver.Flush) {
-      ctx->Driver.Flush(ctx, 0);
+      bool async = !ctx->Shared->HasExternallySharedImages;
+
+      ctx->Driver.Flush(ctx, async ? PIPE_FLUSH_ASYNC : 0);
    }
 }
 

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to