panfrost: Fix modifier conversion shaders search key

The key used to look-up a shader in the modifier conversion shader
hash table is incorrect. It currently uses the address of the key
argument variable while it should use the address already passed into
the key argument. The stack address being different at each call, the
search for a previously created shader always fails and a new one is
created at each call. This commit fixes that leak.

Fixes: ae3fb3089f ("panfrost: Add infrastructure for internal AFBC compute shaders")
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Acked-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36072>
This commit is contained in:
Loïc Molinari
2025-07-11 15:32:13 +02:00
committed by Marge Bot
parent b704b7b5dc
commit 0a581e7408
@@ -417,7 +417,7 @@ get_mod_convert_shaders(struct panfrost_context *ctx,
pthread_mutex_lock(&ctx->mod_convert_shaders.lock);
struct hash_entry *he =
_mesa_hash_table_search(ctx->mod_convert_shaders.shaders, &key);
_mesa_hash_table_search(ctx->mod_convert_shaders.shaders, key);
struct pan_mod_convert_shader_data *shader = he ? he->data : NULL;
pthread_mutex_unlock(&ctx->mod_convert_shaders.lock);