From 86d41cb7bdbce2b38d452b9fb8212d1f031f7bba Mon Sep 17 00:00:00 2001 From: Asahi Lina Date: Wed, 3 May 2023 20:32:00 +0900 Subject: [PATCH] asahi: Implement memory_barrier Cargo culted from panfrost. Signed-off-by: Asahi Lina Part-of: --- src/gallium/drivers/asahi/agx_pipe.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gallium/drivers/asahi/agx_pipe.c b/src/gallium/drivers/asahi/agx_pipe.c index 6ce37d9396b..16f53ef8bac 100644 --- a/src/gallium/drivers/asahi/agx_pipe.c +++ b/src/gallium/drivers/asahi/agx_pipe.c @@ -1353,6 +1353,13 @@ agx_invalidate_resource(struct pipe_context *pctx, } } +static void +agx_memory_barrier(struct pipe_context *pctx, unsigned flags) +{ + /* Be conservative for now, we can try to optimize this more later */ + agx_flush_all(agx_context(pctx), "Memory barrier"); +} + static struct pipe_context * agx_create_context(struct pipe_screen *screen, void *priv, unsigned flags) { @@ -1394,6 +1401,7 @@ agx_create_context(struct pipe_screen *screen, void *priv, unsigned flags) pctx->set_debug_callback = u_default_set_debug_callback; pctx->get_sample_position = u_default_get_sample_position; pctx->invalidate_resource = agx_invalidate_resource; + pctx->memory_barrier = agx_memory_barrier; agx_init_state_functions(pctx); agx_init_query_functions(pctx);