vulkan/runtime: 0-out pipeline cache object
I'm running into crashes because cache->cache_object is uninitialized.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 591da98779
("vulkan: Add a common VkPipelineCache implementation")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16275>
This commit is contained in:
parent
7cd9adeb41
commit
1e7ea18026
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue