panfrost: Don't emit a new FB desc when setting a new FB state
authorBoris Brezillon <boris.brezillon@collabora.com>
Fri, 2 Aug 2019 17:18:45 +0000 (19:18 +0200)
committerBoris Brezillon <boris.brezillon@collabora.com>
Fri, 2 Aug 2019 19:54:58 +0000 (21:54 +0200)
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>
src/gallium/drivers/panfrost/pan_context.c

index a6412de7646902c433a61c66af2b0d18cff3189e..85b9d4d41ceb7312e77d62cee6d81f4c32117a6f 100644 (file)
@@ -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 *