panfrost: Implement texture_barrier
authorIcecream95 <ixn@keemail.me>
Thu, 9 Jul 2020 23:19:07 +0000 (11:19 +1200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 13 Jul 2020 13:35:11 +0000 (13:35 +0000)
This is needed for KHR_blend_equation_advanced with a blend
barrier.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>

src/gallium/drivers/panfrost/pan_context.c

index 0cf7b3e6e5cf0b7b477d3a2c84bedb7afe871347..27e2c35c61103086e119d5e1d706df5e98f0f3e6 100644 (file)
@@ -274,6 +274,13 @@ panfrost_flush(
                 pandecode_next_frame();
 }
 
+static void
+panfrost_texture_barrier(struct pipe_context *pipe, unsigned flags)
+{
+        struct panfrost_context *ctx = pan_context(pipe);
+        panfrost_flush_all_batches(ctx, false);
+}
+
 #define DEFINE_CASE(c) case PIPE_PRIM_##c: return MALI_##c;
 
 static int
@@ -1443,6 +1450,7 @@ panfrost_create_context(struct pipe_screen *screen, void *priv, unsigned flags)
         gallium->flush = panfrost_flush;
         gallium->clear = panfrost_clear;
         gallium->draw_vbo = panfrost_draw_vbo;
+        gallium->texture_barrier = panfrost_texture_barrier;
 
         gallium->set_vertex_buffers = panfrost_set_vertex_buffers;
         gallium->set_constant_buffer = panfrost_set_constant_buffer;