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>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40528>
This commit is contained in:
Icenowy Zheng 2026-03-20 22:08:11 +08:00 committed by Marge Bot
parent aa8dad141c
commit d992474be9
3 changed files with 5 additions and 10 deletions

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)