Don't allocate buffers greater than gallium can handle.
Fixes:
dEQP-VK.api.buffer.basic.size_max_uint64
Fixes: b38879f8c5f57b7f1802 ("vallium: initial import of the vulkan frontend")
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6381>
assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO);
+ /* gallium has max 32-bit buffer sizes */
+ if (pCreateInfo->size > UINT32_MAX)
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+
buffer = vk_alloc2(&device->alloc, pAllocator, sizeof(*buffer), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (buffer == NULL)