Timothy Arceri <tarc...@itsqueeze.com> writes: > The key is just an unsigned int so there is never any real hashing > done. > --- > src/mesa/main/hash.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/src/mesa/main/hash.c b/src/mesa/main/hash.c > index 670438a..eb25d88 100644 > --- a/src/mesa/main/hash.c > +++ b/src/mesa/main/hash.c > @@ -176,21 +176,22 @@ static inline void * > _mesa_HashLookup_unlocked(struct _mesa_HashTable *table, GLuint key) > { > const struct hash_entry *entry; > > assert(table); > assert(key); > > if (key == DELETED_KEY_VALUE) > return table->deleted_key_data; > > - entry = _mesa_hash_table_search(table->ht, uint_key(key)); > + uint32_t hash = uint_hash(key); > + entry = _mesa_hash_table_search_pre_hashed(table->ht, hash, > uint_key(key)); > if (!entry) > return NULL; > > return entry->data; > }
So this cuts out the no-op function call back from the HT code. Seems like a win that's worth the bit of complexity in this very hot path. I would also be happy with not having the temp and just doing: entry = _mesa_hash_table_search_pre_hashed(table->ht, uint_hash(key), uint_key(key)); which I think looks pretty nice. Either way, Reviewed-by: Eric Anholt <e...@anholt.net>
signature.asc
Description: PGP signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev