Home | Info | Community | Development | myReactOS | Contact Us
[static]
Compute hash index from state key.
Definition at line 56 of file prog_cache.c.
Referenced by _mesa_program_cache_insert(), _mesa_search_program_cache(), ctl2_alloc_guid(), and ctl2_find_guid().
{ const GLuint *ikey = (const GLuint *) key; GLuint hash = 0, i; assert(key_size >= 4); /* Make a slightly better attempt at a hash function: */ for (i = 0; i < key_size / sizeof(*ikey); i++) { hash += ikey[i]; hash += (hash << 10); hash ^= (hash >> 6); } return hash; }