Mesa (main): panfrost: Dirty all state when batch is set

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


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

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

panfrost: Dirty all state when batch is set

State uploads are bound to the batch, so if the batch changes, we
invalidate all state. Theoretically this isn't totally optimal but in
practice it should be good enough.

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_job.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c
index c008ca78482..af3f9a235ba 100644
--- a/src/gallium/drivers/panfrost/pan_job.c
+++ b/src/gallium/drivers/panfrost/pan_job.c
@@ -192,6 +192,8 @@ panfrost_get_fresh_batch(struct panfrost_context *ctx,
 {
         struct panfrost_batch *batch = panfrost_get_batch(ctx, key);
 
+        panfrost_dirty_state_all(ctx);
+
         /* The batch has no draw/clear queued, let's return it directly.
          * Note that it's perfectly fine to re-use a batch with an
          * existing clear, we'll just update it with the new clear request.
@@ -230,6 +232,7 @@ panfrost_get_batch_for_fbo(struct panfrost_context *ctx)
          * FB state and when submitting or releasing a job.
          */
         ctx->batch = batch;
+        panfrost_dirty_state_all(ctx);
         return batch;
 }
 
@@ -239,6 +242,7 @@ panfrost_get_fresh_batch_for_fbo(struct panfrost_context *ctx)
         struct panfrost_batch *batch;
 
         batch = panfrost_get_batch(ctx, &ctx->pipe_framebuffer);
+        panfrost_dirty_state_all(ctx);
 
         /* The batch has no draw/clear queued, let's return it directly.
          * Note that it's perfectly fine to re-use a batch with an



More information about the mesa-commit mailing list