turnip: fix UINT64_MAX size wrapping in tu_GetBufferMemoryRequirements()

tu_GetBufferMemoryRequirements() ends up wrapping the UINT64_MAX size
to 0 when aligning.

Fixes:

   dEQP-VK.api.buffer.basic.size_max_uint64

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4493>
This commit is contained in:
Samuel Iglesias Gonsálvez 2021-02-03 09:36:52 +01:00
parent ea42632ba7
commit 5fc5d18aac

View file

@ -1553,7 +1553,7 @@ tu_GetBufferMemoryRequirements2(
pMemoryRequirements->memoryRequirements = (VkMemoryRequirements) {
.memoryTypeBits = 1,
.alignment = 64,
.size = align64(buffer->size, 64),
.size = MAX2(align64(buffer->size, 64), buffer->size),
};
}