Mesa (main): panfrost: Dirty track fragment images

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


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

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Wed May 19 14:40:08 2021 -0400

panfrost: Dirty track fragment images

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.c | 9 ++++++++-
 src/gallium/drivers/panfrost/pan_job.h     | 2 ++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 53d6e664b6d..52a809058f0 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -332,6 +332,11 @@ panfrost_update_state_fs(struct panfrost_batch *batch)
         if (dirty & PAN_DIRTY_STAGE_RENDERER)
                 batch->rsd[st] = panfrost_emit_frag_shader_meta(batch);
 
+        if (dirty & PAN_DIRTY_STAGE_IMAGE) {
+                batch->attribs[st] = panfrost_emit_image_attribs(batch,
+                                &batch->attrib_bufs[st], st);
+        }
+
         panfrost_update_state_tex(batch, st);
 }
 
@@ -415,7 +420,8 @@ panfrost_draw_emit_tiler(struct panfrost_batch *batch,
                 cfg.cull_back_face = rast->cull_face & PIPE_FACE_BACK;
                 cfg.position = pos;
                 cfg.state = batch->rsd[PIPE_SHADER_FRAGMENT];
-                cfg.attributes = panfrost_emit_image_attribs(batch, &cfg.attribute_buffers, PIPE_SHADER_FRAGMENT);
+                cfg.attributes = batch->attribs[PIPE_SHADER_FRAGMENT];
+                cfg.attribute_buffers = batch->attrib_bufs[PIPE_SHADER_FRAGMENT];
                 cfg.viewport = batch->viewport;
                 cfg.varyings = fs_vary;
                 cfg.varying_buffers = fs_vary ? varyings : 0;
@@ -846,6 +852,7 @@ panfrost_set_shader_images(
         const struct pipe_image_view *iviews)
 {
         struct panfrost_context *ctx = pan_context(pctx);
+        ctx->dirty_shader[PIPE_SHADER_FRAGMENT] |= PAN_DIRTY_STAGE_IMAGE;
 
         /* Unbind start_slot...start_slot+count */
         if (!iviews) {
diff --git a/src/gallium/drivers/panfrost/pan_job.h b/src/gallium/drivers/panfrost/pan_job.h
index 038259f9a98..83fe7b45daf 100644
--- a/src/gallium/drivers/panfrost/pan_job.h
+++ b/src/gallium/drivers/panfrost/pan_job.h
@@ -120,6 +120,8 @@ struct panfrost_batch {
         mali_ptr rsd[PIPE_SHADER_TYPES];
         mali_ptr textures[PIPE_SHADER_TYPES];
         mali_ptr samplers[PIPE_SHADER_TYPES];
+        mali_ptr attribs[PIPE_SHADER_TYPES];
+        mali_ptr attrib_bufs[PIPE_SHADER_TYPES];
 };
 
 /* Functions for managing the above */



More information about the mesa-commit mailing list