Mesa (main): lima: Implement texture_barrier

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon May 23 21:18:22 UTC 2022


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

Author: Vasily Khoruzhick <anarsoul at gmail.com>
Date:   Sun May 22 14:13:45 2022 -0700

lima: Implement texture_barrier

Improves x11perf -copywinwin100 from ~1520/sec to ~3700/sec

Reviewed-by: Qiang Yu <yuq825 at gmail.com>
Reviewed-by: Erico Nunes <nunes.erico at gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16658>

---

 docs/features.txt                      | 2 +-
 src/gallium/drivers/lima/lima_job.c    | 9 +++++++++
 src/gallium/drivers/lima/lima_screen.c | 1 +
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/docs/features.txt b/docs/features.txt
index ba9d5778ac0..7c894a57c43 100644
--- a/docs/features.txt
+++ b/docs/features.txt
@@ -220,7 +220,7 @@ GL 4.5, GLSL 4.50 -- all DONE: nvc0, r600, radeonsi, llvmpipe, zink
   GL_ARB_direct_state_access                            DONE (all drivers)
   GL_ARB_get_texture_sub_image                          DONE (all drivers)
   GL_ARB_shader_texture_image_samples                   DONE (i965, nv50, virgl)
-  GL_ARB_texture_barrier                                DONE (freedreno, i965, nv50, vc4, virgl)
+  GL_ARB_texture_barrier                                DONE (freedreno, i965, nv50, vc4, virgl, lima)
   GL_KHR_context_flush_control                          DONE (all - but needs GLX/EGL extension to be useful)
   GL_KHR_robustness                                     DONE (freedreno, i965, virgl)
   GL_EXT_shader_integer_mix                             DONE (all drivers that support GLSL)
diff --git a/src/gallium/drivers/lima/lima_job.c b/src/gallium/drivers/lima/lima_job.c
index 3ec53db2d2a..14f52da4c7e 100644
--- a/src/gallium/drivers/lima/lima_job.c
+++ b/src/gallium/drivers/lima/lima_job.c
@@ -1112,6 +1112,14 @@ lima_pipe_flush(struct pipe_context *pctx, struct pipe_fence_handle **fence,
    }
 }
 
+static void
+lima_texture_barrier(struct pipe_context *pctx, unsigned flags)
+{
+    struct lima_context *ctx = lima_context(pctx);
+
+    lima_flush(ctx);
+}
+
 static bool
 lima_job_compare(const void *s1, const void *s2)
 {
@@ -1146,6 +1154,7 @@ bool lima_job_init(struct lima_context *ctx)
    }
 
    ctx->base.flush = lima_pipe_flush;
+   ctx->base.texture_barrier = lima_texture_barrier;
 
    return true;
 }
diff --git a/src/gallium/drivers/lima/lima_screen.c b/src/gallium/drivers/lima/lima_screen.c
index 6215b2bc7e9..a04cf0c6373 100644
--- a/src/gallium/drivers/lima/lima_screen.c
+++ b/src/gallium/drivers/lima/lima_screen.c
@@ -106,6 +106,7 @@ lima_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_FRAGMENT_SHADER_TEXTURE_LOD:
    case PIPE_CAP_TEXTURE_SWIZZLE:
    case PIPE_CAP_VERTEX_COLOR_UNCLAMPED:
+   case PIPE_CAP_TEXTURE_BARRIER:
       return 1;
 
    /* Unimplemented, but for exporting OpenGL 2.0 */



More information about the mesa-commit mailing list