anv: fix descriptor set free
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Mon, 27 Jul 2020 09:06:17 +0000 (12:06 +0300)
committerMarge Bot <eric+marge@anholt.net>
Tue, 28 Jul 2020 14:51:15 +0000 (14:51 +0000)
commit1cdd161a30297c13908134d8d205a7a377ec807a
treeacfa32f23eff7dae5e3fc21d28e01e64e0c5af7c
parent845a50ee2525c6cc4e6160eda1826c0670e0daaf
anv: fix descriptor set free

Once we start going through the free list of the descriptor set pool,
we might use a free entry larger than the descriptor set we want to
allocate. When we free that descriptor set, we use the size of the set
rather than the size of the entry that was picked. This leads to leaks
of some amount of descriptor set pool.

This fix saves the size of the entry in the descriptor set so we know
what amount of the pool needs to freed.

v2: Don't bother adding a new size field

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Cc: <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3324
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6084>
src/intel/vulkan/anv_descriptor_set.c
src/intel/vulkan/anv_private.h