freedreno: handle case of shadowing current render target
authorRob Clark <robdclark@chromium.org>
Fri, 21 Aug 2020 22:58:37 +0000 (15:58 -0700)
committerMarge Bot <eric+marge@anholt.net>
Mon, 24 Aug 2020 20:15:23 +0000 (20:15 +0000)
commit1fa43a4a8ec37aacac4d333a4c72987819188e69
tree46aaa408a8552565494d496faa5b8ba0a3d9107b
parent743ad7bf6b8023c9bfdc98e793ed937d0f567d07
freedreno: handle case of shadowing current render target

If you have a sequence where there is a single buffer associated with
the current render target, and then you end up shadowing it on the 3d
pipe (u_blitter), because of how we swap the new shadow and rsc before
the back-blit, you could end up confusing things into thinking that
the blitters framebuffer state is the same as the current framebuffer
state.

Re-organizing the sequence to swap after the blit is complicated when
also having to deal with CPU memcpy blit path, and the batch/rsc
accounting.  So instead just detect this case and flush if we need to.

Fixes:
dEQP-GLES31.functional.stencil_texturing.render.depth24_stencil8_clear
dEQP-GLES31.functional.stencil_texturing.render.depth24_stencil8_draw

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6434>
.gitlab-ci/deqp-freedreno-a630-fails.txt
src/gallium/drivers/freedreno/freedreno_resource.c