freedreno/a6xx: Fix uncompressed resource vs stale CSO
authorRob Clark <robdclark@chromium.org>
Sun, 28 Feb 2021 19:06:13 +0000 (11:06 -0800)
committerMarge Bot <eric+marge@anholt.net>
Mon, 1 Mar 2021 20:01:07 +0000 (20:01 +0000)
commitd7c38af3da86733084267bed3c90f495a2ac79c8
tree8f694a0b35f15b57c3e57667e759403c93a1b82b
parent73f70d9b5f81d71699737e1468bc72abe5d8747c
freedreno/a6xx: Fix uncompressed resource vs stale CSO

A sequence like:

1) create sampler view CSO with UBWC resource
2) later create another sampler view or image view with the same
   resource, but a format that triggers demoting the resource to
   uncompressed
3) bind CSO created in step #1

would not work correctly, because the CSO created in step #1 is still
setup for UBWC, despite the fact that the resource had been demoted to
uncompressed.

Fortunately this is easy enough to detect, as the resource's seqno would
have been updated.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9321>
src/gallium/drivers/freedreno/a6xx/fd6_emit.c
src/gallium/drivers/freedreno/a6xx/fd6_texture.c
src/gallium/drivers/freedreno/a6xx/fd6_texture.h