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>
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;
}
};
struct agx_meta_shader {
+ struct agx_meta_key key;
struct agx_shader_info info;
struct agx_bo *bo;
uint32_t ptr;