pvr: move PVR_BUFFER_MEMORY_PADDING_SIZE definition to pvr_buffer.h

This memory padding is enforced by GetBufferMemoryRequirements2 and
might be then checked against to decide whether it's enough.

Move it to pvr_buffer.h for further assertions.

Backport-to: 25.3
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Reviewed-by: Ella Stanforth <ella@igalia.com>
(cherry picked from commit d992474be9)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
This commit is contained in:
Icenowy Zheng 2026-03-20 22:08:11 +08:00 committed by Eric Engestrom
parent 778c3580e7
commit e62ef26e01
4 changed files with 6 additions and 11 deletions

View file

@ -1854,7 +1854,7 @@
"description": "pvr: move PVR_BUFFER_MEMORY_PADDING_SIZE definition to pvr_buffer.h",
"nominated": true,
"nomination_type": 4,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -49,11 +49,6 @@
*/
#define PVR_GLOBAL_FREE_LIST_GROW_THRESHOLD 13U
/* Amount of padding required for VkBuffers to ensure we don't read beyond
* a page boundary.
*/
#define PVR_BUFFER_MEMORY_PADDING_SIZE 4
/* Default size in bytes used by pvr_CreateDevice() for setting up the
* suballoc_general, suballoc_pds and suballoc_usc suballocators.
*

View file

@ -19,6 +19,11 @@
#include "pvr_common.h"
/* Amount of padding required for VkBuffers to ensure we don't read beyond
* a page boundary.
*/
#define PVR_BUFFER_MEMORY_PADDING_SIZE 4
struct pvr_buffer {
struct vk_buffer vk;

View file

@ -73,11 +73,6 @@
#include "vk_sampler.h"
#include "vk_util.h"
/* Amount of padding required for VkBuffers to ensure we don't read beyond
* a page boundary.
*/
#define PVR_BUFFER_MEMORY_PADDING_SIZE 4
/** Gets the amount of memory to allocate per-core for a tile buffer. */
static uint32_t
pvr_get_tile_buffer_size_per_core(const struct pvr_device *device)