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>
(cherry picked from commit 9924fecee6)
This commit is contained in:
Mike Blumenkrantz 2022-04-20 15:07:03 -04:00 committed by Dylan Baker
parent e05e02e340
commit 700fded174
2 changed files with 9 additions and 3 deletions

View file

@ -1012,7 +1012,7 @@
"description": "zink: fix surface/bufferview cache comparisons",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"because_sha": null
},
{

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