From 700fded17455b469708907ab32ce9d2d6f0df470 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 20 Apr 2022 15:07:03 -0400 Subject: [PATCH] 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 Part-of: (cherry picked from commit 9924fecee6412f1cad65d7d7347681856e3a525c) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_resource.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index bac861054e3..0cdb43e0a4e 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1012,7 +1012,7 @@ "description": "zink: fix surface/bufferview cache comparisons", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "because_sha": null }, { diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c index 2c6f7995882..cd55921f5d5 100644 --- a/src/gallium/drivers/zink/zink_resource.c +++ b/src/gallium/drivers/zink/zink_resource.c @@ -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