radv: add a size check in radv_create_buffer for Android
authorChia-I Wu <olvaffe@gmail.com>
Wed, 15 Feb 2023 19:11:16 +0000 (11:11 -0800)
committerMarge Bot <emma+marge@anholt.net>
Fri, 17 Feb 2023 18:14:34 +0000 (18:14 +0000)
commit4459668b6e74094b93f13da377077c4f26c9b7b9
treea466c18c1f9dbb3c2819810f739367d1663c76d8
parente13074d76312ca95648460629aef7021ee7482d1
radv: add a size check in radv_create_buffer for Android

This is to make dEQP-VK.api.buffer.basic.size_max_uint64 pass on
android.

The test creates a buffer of size UINT64_MAX and makes sure the memory
requirement for the buffer is sane.  It fails because our memory
requirement is "align64(UINT64_MAX, 16)" which is 0 after overflow.

The test checks maintenance4's maxBufferSize and is skipped normally.
But the extension can be disabled on an android build.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21346>
src/amd/vulkan/radv_device.c