mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 02:58:05 +02: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> (cherry picked from commitc0f8465fa8)
This commit is contained in:
parent
07b1eddc74
commit
87620550cc
2 changed files with 6 additions and 1 deletions
|
|
@ -64,7 +64,7 @@
|
|||
"description": "panvk: Check for maxBufferSize in panvk_CreateBuffer",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "822478ec20c8bca8a3a7e23cffc7ceee7773ff03",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
@ -82,6 +84,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