Mesa (main): panfrost: Add the usual clean/dirty helpers

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri May 21 15:15:15 UTC 2021


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

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Wed May 19 13:26:45 2021 -0400

panfrost: Add the usual clean/dirty helpers

Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10888>

---

 src/gallium/drivers/panfrost/pan_context.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/src/gallium/drivers/panfrost/pan_context.h b/src/gallium/drivers/panfrost/pan_context.h
index 14786b6b018..d16ae59f469 100644
--- a/src/gallium/drivers/panfrost/pan_context.h
+++ b/src/gallium/drivers/panfrost/pan_context.h
@@ -381,5 +381,24 @@ panfrost_vertex_buffer_address(struct panfrost_context *ctx, unsigned i);
 void
 panfrost_compute_context_init(struct pipe_context *pctx);
 
+static inline void
+panfrost_dirty_state_all(struct panfrost_context *ctx)
+{
+        ctx->dirty = ~0;
+
+        for (unsigned i = 0; i < PIPE_SHADER_TYPES; ++i)
+                ctx->dirty_shader[i] = ~0;
+}
+
+static inline void
+panfrost_clean_state_3d(struct panfrost_context *ctx)
+{
+        ctx->dirty = 0;
+
+        for (unsigned i = 0; i < PIPE_SHADER_TYPES; ++i) {
+                if (i != PIPE_SHADER_COMPUTE)
+                        ctx->dirty_shader[i] = 0;
+        }
+}
 
 #endif



More information about the mesa-commit mailing list