lavapipe: zero-init sampler objects

The cso code hashes these as a block of bytes.  This silences some
Valgrind uninitialized memory warnings and possibly avoids creating
some redundant sampler instances.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18953>
This commit is contained in:
Brian Paul 2022-10-03 15:18:31 -06:00 committed by Marge Bot
parent 2aac8ef125
commit 6dcad8a13b

View file

@ -2223,8 +2223,8 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_CreateSampler(
assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO);
sampler = vk_alloc2(&device->vk.alloc, pAllocator, sizeof(*sampler), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
sampler = vk_zalloc2(&device->vk.alloc, pAllocator, sizeof(*sampler), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (!sampler)
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);