mesa/src/mesa
Julia Zhang 47e74ba175 mesa/st: use drawable->ID as hash for drawable_ht
Using address of drawable as hash table key will cause memory issue in this
situation:

1. drawable A with address addr is destroyed and deleted from the hash table.
2. drawable B with same address addr is created and added to the hash table
right after 1 is done.
3. st_framebuffers_purge will seach the hash table with drawable addr that
associated with each framebuffer. If drawable is not in the hash table, then
free this framebuffer.

So when drawable B is created, then the framebuffer that associated with
drawable A will not be freed in time. This will cause framebuffer memory leak.

Since drawable->ID is unique, this uses drawable-ID as pre-hash to store
drawable in hash table. This also removes key_hash_function because we already
use drawable-ID as pre-hash when insert the data and we need to avoid assert of
_mesa_hash_table_search_pre_hashed fail.

Signed-off-by: Julia Zhang <Julia.Zhang@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31161>
2024-10-17 21:43:32 +00:00
..
main gallium: delete duplicated viewmask member in draw info 2024-10-15 14:01:42 +00:00
math mesa: optimize setting the identity matrix 2023-12-08 04:25:51 +00:00
program mesa/prog_to_nir: use derivative builder 2024-10-17 09:50:19 +00:00
state_tracker mesa/st: use drawable->ID as hash for drawable_ht 2024-10-17 21:43:32 +00:00
vbo mesa: Reset vbo attributes after flushing them to Current in glPopAttrib 2024-09-11 09:58:52 +00:00
x86 util: cleanup cpuinfo.* and it's related files 2022-11-15 19:06:07 +00:00
meson.build build: pass licensing information in SPDX form 2024-06-29 12:42:49 -07:00