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

Author: Asahi Lina <[email protected]>
Date:   Wed May 10 14:11:26 2023 +0900

asahi: Make framebuffer texture barriers a no-op

Framebuffer fetch is coherent, so there is no need for barriers here.
This avoids pointless flushing if an app calls glBlendBarrier().

Signed-off-by: Asahi Lina <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22971>

---

 src/gallium/drivers/asahi/agx_state.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/gallium/drivers/asahi/agx_state.c 
b/src/gallium/drivers/asahi/agx_state.c
index 3931b6b595b..f37e56cae44 100644
--- a/src/gallium/drivers/asahi/agx_state.c
+++ b/src/gallium/drivers/asahi/agx_state.c
@@ -2746,6 +2746,11 @@ static void
 agx_texture_barrier(struct pipe_context *pipe, unsigned flags)
 {
    struct agx_context *ctx = agx_context(pipe);
+
+   /* Framebuffer fetch is coherent, so barriers are a no-op. */
+   if (flags == PIPE_TEXTURE_BARRIER_FRAMEBUFFER)
+      return;
+
    agx_flush_all(ctx, "Texture barrier");
 }
 

Reply via email to