asahi: derive ht

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28056>
This commit is contained in:
Alyssa Rosenzweig 2024-03-07 16:32:55 -04:00 committed by Marge Bot
parent be5c288dbf
commit da59672e2b

View file

@ -206,23 +206,13 @@ agx_get_meta_shader(struct agx_meta_cache *cache, struct agx_meta_key *key)
return ret;
}
static uint32_t
key_hash(const void *key)
{
return _mesa_hash_data(key, sizeof(struct agx_meta_key));
}
static bool
key_compare(const void *a, const void *b)
{
return memcmp(a, b, sizeof(struct agx_meta_key)) == 0;
}
DERIVE_HASH_TABLE(agx_meta_key);
void
agx_meta_init(struct agx_meta_cache *cache, struct agx_device *dev)
{
agx_pool_init(&cache->pool, dev, AGX_BO_EXEC | AGX_BO_LOW_VA, true);
cache->ht = _mesa_hash_table_create(NULL, key_hash, key_compare);
cache->ht = agx_meta_key_table_create(NULL);
cache->dev = dev;
}