zink: reduce hashed region of zink_descriptor_layout_key

only the first 3 members of VkDescriptorSetLayoutBinding are useful here

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13483>
This commit is contained in:
Mike Blumenkrantz 2021-10-18 11:48:33 -04:00 committed by Marge Bot
parent 103e93cbe6
commit 66a0d8204f

View file

@ -388,7 +388,9 @@ hash_descriptor_layout(const void *key)
uint32_t hash = 0;
const struct zink_descriptor_layout_key *k = key;
hash = XXH32(&k->num_bindings, sizeof(unsigned), hash);
hash = XXH32(k->bindings, k->num_bindings * sizeof(VkDescriptorSetLayoutBinding), hash);
/* only hash first 3 members: no holes and the rest are always constant */
for (unsigned i = 0; i < k->num_bindings; i++)
hash = XXH32(&k->bindings[i], offsetof(VkDescriptorSetLayoutBinding, stageFlags), hash);
return hash;
}