freedreno: Move framebuffer state checks under a ctx->dirty flag.

Anything changing this should have flagged FD_DIRTY_FRAMEBUFFER.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8602>
This commit is contained in:
Eric Anholt 2021-01-22 10:38:09 -08:00 committed by Marge Bot
parent 6e29757a57
commit 49b83509fe

View file

@ -105,25 +105,26 @@ batch_draw_tracking(struct fd_batch *batch, const struct pipe_draw_info *info,
}
}
if (ctx->dirty & FD_DIRTY_FRAMEBUFFER) {
for (unsigned i = 0; i < pfb->nr_cbufs; i++) {
struct pipe_resource *surf;
for (unsigned i = 0; i < pfb->nr_cbufs; i++) {
struct pipe_resource *surf;
if (!pfb->cbufs[i])
continue;
if (!pfb->cbufs[i])
continue;
surf = pfb->cbufs[i]->texture;
surf = pfb->cbufs[i]->texture;
if (fd_resource(surf)->valid) {
restore_buffers |= PIPE_CLEAR_COLOR0 << i;
} else {
batch->invalidated |= PIPE_CLEAR_COLOR0 << i;
}
if (fd_resource(surf)->valid) {
restore_buffers |= PIPE_CLEAR_COLOR0 << i;
} else {
batch->invalidated |= PIPE_CLEAR_COLOR0 << i;
buffers |= PIPE_CLEAR_COLOR0 << i;
if (ctx->dirty & FD_DIRTY_FRAMEBUFFER)
resource_written(batch, pfb->cbufs[i]->texture);
}
buffers |= PIPE_CLEAR_COLOR0 << i;
if (ctx->dirty & FD_DIRTY_FRAMEBUFFER)
resource_written(batch, pfb->cbufs[i]->texture);
}
if (ctx->dirty & FD_DIRTY_BLEND) {