zink: fix surface/bufferview cache comparisons

these caches ignore pNext from the create info since the pNext cannot
affect the eventual object that is created, so comparing it will break
the hash table

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16563>
This commit is contained in:
Mike Blumenkrantz 2022-04-20 15:07:03 -04:00 committed by Marge Bot
parent 7057a36359
commit 9924fecee6

View file

@ -69,13 +69,19 @@
static bool
equals_ivci(const void *a, const void *b)
{
return memcmp(a, b, sizeof(VkImageViewCreateInfo)) == 0;
const uint8_t *pa = a;
const uint8_t *pb = b;
size_t offset = offsetof(VkImageViewCreateInfo, flags);
return memcmp(pa + offset, pb + offset, sizeof(VkImageViewCreateInfo) - offset) == 0;
}
static bool
equals_bvci(const void *a, const void *b)
{
return memcmp(a, b, sizeof(VkBufferViewCreateInfo)) == 0;
const uint8_t *pa = a;
const uint8_t *pb = b;
size_t offset = offsetof(VkBufferViewCreateInfo, flags);
return memcmp(pa + offset, pb + offset, sizeof(VkBufferViewCreateInfo) - offset) == 0;
}
static void