freedreno: Fix spurious flush

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
This commit is contained in:
Rob Clark 2020-10-22 14:43:35 -07:00 committed by Marge Bot
parent 156d7e45f7
commit 3f88abd621
1 changed files with 9 additions and 2 deletions

View File

@ -220,13 +220,20 @@ fd_set_framebuffer_state(struct pipe_context *pctx,
framebuffer->width, framebuffer->height,
framebuffer->layers, framebuffer->samples);
fd_context_switch_from(ctx);
cso = &ctx->framebuffer;
if (util_framebuffer_state_equal(cso, framebuffer))
return;
/* Do this *after* checking that the framebuffer state is actually
* changing. In the fd_blitter_clear() path, we get a pfb update
* to restore the current pfb state, which should not trigger us
* to flush (as that can cause the batch to be freed at a point
* before fd_clear() returns, but after the point where it expects
* flushes to potentially happen.
*/
fd_context_switch_from(ctx);
util_copy_framebuffer_state(cso, framebuffer);
cso->samples = util_framebuffer_get_num_samples(cso);