freedreno: fix inorder rendering case
authorRob Clark <robdclark@gmail.com>
Tue, 25 Sep 2018 16:15:58 +0000 (12:15 -0400)
committerRob Clark <robdclark@gmail.com>
Thu, 27 Sep 2018 19:32:39 +0000 (15:32 -0400)
Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/freedreno_state.c

index a50ae383b2313cb93e36b11ee2f5f1321395a212..96a15250b9d532272cf462c8c1cdfee727c3b6cb 100644 (file)
@@ -215,6 +215,12 @@ fd_set_framebuffer_state(struct pipe_context *pctx,
                framebuffer->width, framebuffer->height,
                framebuffer->layers, framebuffer->samples);
 
+       cso = &ctx->framebuffer;
+
+       util_copy_framebuffer_state(cso, framebuffer);
+
+       cso->samples = util_framebuffer_get_num_samples(cso);
+
        if (ctx->screen->reorder) {
                struct fd_batch *old_batch = NULL;
 
@@ -240,14 +246,9 @@ fd_set_framebuffer_state(struct pipe_context *pctx,
                DBG("%d: cbufs[0]=%p, zsbuf=%p", ctx->batch->needs_flush,
                                framebuffer->cbufs[0], framebuffer->zsbuf);
                fd_batch_flush(ctx->batch, false, false);
+               util_copy_framebuffer_state(&ctx->batch->framebuffer, cso);
        }
 
-       cso = &ctx->framebuffer;
-
-       util_copy_framebuffer_state(cso, framebuffer);
-
-       cso->samples = util_framebuffer_get_num_samples(cso);
-
        ctx->dirty |= FD_DIRTY_FRAMEBUFFER;
 
        ctx->disabled_scissor.minx = 0;