From da59672e2bf168df7142e077059588379bac7d9d Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 7 Mar 2024 16:32:55 -0400 Subject: [PATCH] asahi: derive ht MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alyssa Rosenzweig Reviewed-by: Marek Olšák Part-of: --- src/asahi/lib/agx_meta.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/asahi/lib/agx_meta.c b/src/asahi/lib/agx_meta.c index 094b202b1bf..5b9529fa5b9 100644 --- a/src/asahi/lib/agx_meta.c +++ b/src/asahi/lib/agx_meta.c @@ -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; }