diff --git a/src/vulkan/runtime/vk_pipeline_cache.c b/src/vulkan/runtime/vk_pipeline_cache.c index 87310eb8dec..6ed7a397203 100644 --- a/src/vulkan/runtime/vk_pipeline_cache.c +++ b/src/vulkan/runtime/vk_pipeline_cache.c @@ -562,8 +562,8 @@ vk_pipeline_cache_create(struct vk_device *device, assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO); - cache = vk_object_alloc(device, pAllocator, sizeof(*cache), - VK_OBJECT_TYPE_PIPELINE_CACHE); + cache = vk_object_zalloc(device, pAllocator, sizeof(*cache), + VK_OBJECT_TYPE_PIPELINE_CACHE); if (cache == NULL) return NULL; diff --git a/src/vulkan/runtime/vk_pipeline_cache.h b/src/vulkan/runtime/vk_pipeline_cache.h index 2d1eeb1d231..37fe2e7b85c 100644 --- a/src/vulkan/runtime/vk_pipeline_cache.h +++ b/src/vulkan/runtime/vk_pipeline_cache.h @@ -120,6 +120,7 @@ vk_pipeline_cache_object_init(struct vk_device *device, const struct vk_pipeline_cache_object_ops *ops, const void *key_data, uint32_t key_size) { + memset(object, 0, sizeof(*object)); object->device = device; object->ops = ops; p_atomic_set(&object->ref_cnt, 1);