freedreno/a6xx: invalidate tex state cache entries on rebind
authorRob Clark <robdclark@chromium.org>
Fri, 24 Apr 2020 22:15:09 +0000 (15:15 -0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 29 Apr 2020 00:08:57 +0000 (00:08 +0000)
commit6de01faac5a20208422fb75d22f2bd88c53f53d8
tree8834a20b9c73ad7de34d4ba6c171abb9044a9de3
parentca05e6b04d2f96a3de09d6940bea8edb5c852dad
freedreno/a6xx: invalidate tex state cache entries on rebind

When a resource's backing bo changes, its seqno will be incremented.
Which would result in a new tex state cache key, and nothing to clean
up the old tex state until the sampler view/state is destroyed.  But
in some games, that may never happen, or at least not happen before
we run out of memory.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2830
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4744>
src/gallium/drivers/freedreno/a6xx/fd6_texture.c
src/gallium/drivers/freedreno/freedreno_context.h
src/gallium/drivers/freedreno/freedreno_resource.c