freedreno: fix corrupted fb state
authorRob Clark <robdclark@gmail.com>
Mon, 10 Sep 2018 14:58:28 +0000 (10:58 -0400)
committerRob Clark <robdclark@gmail.com>
Thu, 27 Sep 2018 19:27:38 +0000 (15:27 -0400)
In c3d9f29b we allowed ctx->batch to be null, and started tracking the
current framebuffer state in fd_context.  But the existing logic in
fd_blitter_pipe_begin() would, if !ctx->batch, set null fb state to be
restored after blit.  Which broke the world of deqp (and probably other
things)

Fixes: c3d9f29b781 freedreno: allocate ctx's batch on demand
Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/freedreno_resource.c
src/gallium/drivers/freedreno/freedreno_state.c

index 344004f6965a931073e186e5695c2a7b904714f9..88d420bdf3eff2e5b6396481cfa17beb020f6ce1 100644 (file)
@@ -1085,8 +1085,7 @@ fd_blitter_pipe_begin(struct fd_context *ctx, bool render_cond, bool discard,
        util_blitter_save_depth_stencil_alpha(ctx->blitter, ctx->zsa);
        util_blitter_save_stencil_ref(ctx->blitter, &ctx->stencil_ref);
        util_blitter_save_sample_mask(ctx->blitter, ctx->sample_mask);
-       util_blitter_save_framebuffer(ctx->blitter,
-                       ctx->batch ? &ctx->batch->framebuffer : NULL);
+       util_blitter_save_framebuffer(ctx->blitter, &ctx->framebuffer);
        util_blitter_save_fragment_sampler_states(ctx->blitter,
                        ctx->tex[PIPE_SHADER_FRAGMENT].num_samplers,
                        (void **)ctx->tex[PIPE_SHADER_FRAGMENT].samplers);
index 3ce8b6ed9fc144d9de131bf3f4311e777b4720d3..a50ae383b2313cb93e36b11ee2f5f1321395a212 100644 (file)
@@ -211,6 +211,10 @@ fd_set_framebuffer_state(struct pipe_context *pctx,
        struct fd_context *ctx = fd_context(pctx);
        struct pipe_framebuffer_state *cso;
 
+       DBG("%ux%u, %u layers, %u samples",
+               framebuffer->width, framebuffer->height,
+               framebuffer->layers, framebuffer->samples);
+
        if (ctx->screen->reorder) {
                struct fd_batch *old_batch = NULL;