panvk: Don't leak shader binaries when loaded from the cache
own_bin needs to be set to true if we want the bin_ptr to be freed.
Fixes: 3d2cc01f8a ("panvk: Add create_shader_from_binary")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38923>
This commit is contained in:
@@ -1642,6 +1642,7 @@ panvk_deserialize_shader_variant(struct vk_device *vk_dev,
|
||||
if (shader->bin_ptr == NULL)
|
||||
return panvk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
|
||||
|
||||
shader->own_bin = true;
|
||||
blob_copy_bytes(blob, (void *)shader->bin_ptr, shader->bin_size);
|
||||
|
||||
result = shader_desc_info_deserialize(device, blob, shader);
|
||||
|
||||
Reference in New Issue
Block a user