[v2,6/9] panfrost: Don't emit a new FB desc when setting a new FB state

Submitted by Boris Brezillon on Aug. 2, 2019, 5:18 p.m.

Details

Message ID 20190802171848.7805-7-boris.brezillon@collabora.com
State Accepted
Commit 8227d284f7f7bbaf795c04b6d1e7081f7fb0f535
Headers show
Series "panfrost: Allocate the polygon lists on-demand" ( rev: 2 ) in Mesa

Commit Message

Boris Brezillon Aug. 2, 2019, 5:18 p.m.
The FB desc will be emitted/attached on the first draw targetting
this new FB.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
---
Changes in v2:
* Add Alyssa's R-b
---
 src/gallium/drivers/panfrost/pan_context.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index a6412de76469..85b9d4d41ceb 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);
 
         /* Invalidate the FBO job cache since we've just been assigned a new
          * FB state.
@@ -2396,7 +2399,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 *