asahi: Put meta shader keys into the meta shader itself

The hash table needs a key pointer with at least the lifetime of the
hash entry, which the key pointer we get does not have (since it is
stack-allocated by agx_build_meta). Copy it into the shader struct
itself and use that for the hash table.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
This commit is contained in:
Asahi Lina 2022-12-14 13:28:26 +09:00 committed by Marge Bot
parent c12153cd89
commit 9fc2c0f341
2 changed files with 3 additions and 1 deletions

View file

@ -150,7 +150,8 @@ agx_get_meta_shader(struct agx_meta_cache *cache, struct agx_meta_key *key)
if (!ret)
ret = agx_build_background_shader(cache, key);
_mesa_hash_table_insert(cache->ht, key, ret);
ret->key = *key;
_mesa_hash_table_insert(cache->ht, &ret->key, ret);
return ret;
}

View file

@ -30,6 +30,7 @@ struct agx_meta_key {
};
struct agx_meta_shader {
struct agx_meta_key key;
struct agx_shader_info info;
struct agx_bo *bo;
uint32_t ptr;