zink: use align64 for allocation sizes

avoid 32bit sint overflows

fixes #5568

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13560>
This commit is contained in:
Mike Blumenkrantz 2021-10-27 16:37:03 -04:00 committed by Marge Bot
parent 2e9e113b7f
commit c4a513d978

View file

@ -263,7 +263,7 @@ bo_create_internal(struct zink_screen *screen,
mai.memoryTypeIndex = screen->heap_map[heap];
if (screen->info.mem_props.memoryTypes[mai.memoryTypeIndex].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) {
alignment = MAX2(alignment, screen->info.props.limits.minMemoryMapAlignment);
mai.allocationSize = align(mai.allocationSize, screen->info.props.limits.minMemoryMapAlignment);
mai.allocationSize = align64(mai.allocationSize, screen->info.props.limits.minMemoryMapAlignment);
}
VkResult ret = VKSCR(AllocateMemory)(screen->dev, &mai, NULL, &bo->mem);
if (!zink_screen_handle_vkresult(screen, ret))