anv: allocate zeroed device object
When enabling a new feature we made the mistake of initializing some fields of the device object conditionally, which leads to crashes later. Initializing those fields would be a trivial fix, but it's probably better to just zero everything at allocation time and prevent any future screwups. Device objects are allocated rarely enough for this additional memset to not matter for performance. Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13221>
This commit is contained in:
committed by
Marge Bot
parent
1f7e11a190
commit
434df66792
@@ -2922,7 +2922,7 @@ VkResult anv_CreateDevice(
|
||||
queue_priority ? queue_priority->globalPriority :
|
||||
VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT;
|
||||
|
||||
device = vk_alloc2(&physical_device->instance->vk.alloc, pAllocator,
|
||||
device = vk_zalloc2(&physical_device->instance->vk.alloc, pAllocator,
|
||||
sizeof(*device), 8,
|
||||
VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
|
||||
if (!device)
|
||||
|
||||
Reference in New Issue
Block a user