zink: Fully initialize VkBufferViewCreateInfo for hashing

Makes hashing achieve higher hit rate, and valgrind happier.

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13371>
(cherry picked from commit ae525da0e4)
This commit is contained in:
Witold Baryluk 2021-10-15 00:40:14 +02:00 committed by Eric Engestrom
parent 2d6c11843d
commit b67308a449
2 changed files with 5 additions and 2 deletions

View file

@ -850,7 +850,7 @@
"description": "zink: Fully initialize VkBufferViewCreateInfo for hashing",
"nominated": false,
"nomination_type": null,
"resolution": 4,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View file

@ -626,7 +626,10 @@ static VkBufferViewCreateInfo
create_bvci(struct zink_context *ctx, struct zink_resource *res, enum pipe_format format, uint32_t offset, uint32_t range)
{
struct zink_screen *screen = zink_screen(ctx->base.screen);
VkBufferViewCreateInfo bvci = {0};
VkBufferViewCreateInfo bvci;
// Zero whole struct (including alignment holes), so hash_bufferview
// does not access potentially uninitialized data.
memset(&bvci, 0, sizeof(bvci));
bvci.sType = VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO;
bvci.pNext = NULL;
bvci.buffer = res->obj->buffer;