mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-23 06:28:08 +02:00
cso: don't release sampler states that are bound
This fixes random radeonsi GPU hangs in Batman Arkham: Origins (Wine) and
probably many other games too.
cso_cache deletes sampler states when the cache size is too big and doesn't
check which sampler states are bound, causing use-after-free in drivers.
Because of that, radeonsi uploaded garbage sampler states and the hardware
went bananas. Other drivers may have experienced similar issues.
Cc: 12.0 13.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
(cherry picked from commit 6dc96de303)
This commit is contained in:
parent
6b1c3c3aa0
commit
f71c3734ce
1 changed files with 3 additions and 1 deletions
|
|
@ -188,7 +188,9 @@ cso_insert_state(struct cso_cache *sc,
|
|||
void *state)
|
||||
{
|
||||
struct cso_hash *hash = _cso_hash_for_type(sc, type);
|
||||
sanitize_hash(sc, hash, type, sc->max_size);
|
||||
|
||||
if (type != CSO_SAMPLER)
|
||||
sanitize_hash(sc, hash, type, sc->max_size);
|
||||
|
||||
return cso_hash_insert(hash, hash_key, state);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue