[Mesa-dev] [PATCH 6/9] panfrost: Don't emit a new FB desc when setting a new FB state

Boris Brezillon boris.brezillon at collabora.com
Fri Aug 2 10:12:54 UTC 2019


The FB desc will be emitted/attached on the first draw targetting
this new FB.

Signed-off-by: Boris Brezillon <boris.brezillon at collabora.com>
---
 src/gallium/drivers/panfrost/pan_context.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 1091caeb1148..2b7906eea155 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -2384,6 +2384,9 @@ panfrost_set_framebuffer_state(struct pipe_context *pctx,
 
         if (!is_scanout || has_draws)
                 panfrost_flush(pctx, NULL, PIPE_FLUSH_END_OF_FRAME);
+        else
+                assert(!ctx->payloads[PIPE_SHADER_VERTEX].postfix.framebuffer &&
+                       !ctx->payloads[PIPE_SHADER_FRAGMENT].postfix.framebuffer);
 
         util_copy_framebuffer_state(&ctx->pipe_framebuffer, fb);
 
@@ -2391,7 +2394,8 @@ panfrost_set_framebuffer_state(struct pipe_context *pctx,
         struct panfrost_screen *screen = pan_screen(ctx->base.screen);
 
         panfrost_hint_afbc(screen, &ctx->pipe_framebuffer);
-        panfrost_attach_vt_framebuffer(ctx, false);
+        for (unsigned i = 0; i < PIPE_SHADER_TYPES; ++i)
+                ctx->payloads[i].postfix.framebuffer = 0;
 }
 
 static void *
-- 
2.21.0



More information about the mesa-dev mailing list