mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-09 17:00:13 +01:00
panvk: Check for maxBufferSize in panvk_CreateBuffer
This fix failure on "dEQP-VK.api.buffer.basic.size_max_uint64".
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Fixes: 822478ec20 ("panvk: Move the VkBuffer logic to its own source file")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29783>
This commit is contained in:
parent
7dd771b2d7
commit
c0f8465fa8
1 changed files with 5 additions and 0 deletions
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
#include "vk_log.h"
|
||||
|
||||
#define PANVK_MAX_BUFFER_SIZE (1 << 30)
|
||||
|
||||
VKAPI_ATTR VkDeviceAddress VKAPI_CALL
|
||||
panvk_GetBufferDeviceAddress(VkDevice _device,
|
||||
const VkBufferDeviceAddressInfo *pInfo)
|
||||
|
|
@ -89,6 +91,9 @@ panvk_CreateBuffer(VkDevice _device, const VkBufferCreateInfo *pCreateInfo,
|
|||
|
||||
assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO);
|
||||
|
||||
if (pCreateInfo->size > PANVK_MAX_BUFFER_SIZE)
|
||||
return vk_error(device, VK_ERROR_OUT_OF_DEVICE_MEMORY);
|
||||
|
||||
buffer =
|
||||
vk_buffer_create(&device->vk, pCreateInfo, pAllocator, sizeof(*buffer));
|
||||
if (buffer == NULL)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue