panvk: raise descriptor limits on valhall

Previously, our descriptor set limits were set based on the hardware
limits on bifrost. On valhall, the hardware descriptor table limits are
much higher. We need to advertise higher update-after-bind descriptor
limits for descriptor indexing, so might as well increase these also.
The 2^20 limit is the same as nvk and honeykrisp.

Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35408>
This commit is contained in:
Olivia Lee 2025-06-08 17:32:44 -07:00 committed by Marge Bot
parent 88ac602cc2
commit f90b9b3642
2 changed files with 35 additions and 6 deletions

View file

@ -27,6 +27,7 @@
(MAX_DYNAMIC_UNIFORM_BUFFERS + MAX_DYNAMIC_STORAGE_BUFFERS)
#if PAN_ARCH <= 7
/* On Bifrost, this is a software limit. We pick the minimum required by
* Vulkan, because Bifrost GPUs don't have unified descriptor tables,
* which forces us to aggregate all descriptors from all sets and dispatch
@ -34,12 +35,6 @@
* more sets we support the more copies we are likely to have to do at
* draw time. */
#define MAX_SETS 4
#else
/* Valhall has native support for descriptor sets, and allows a maximum
* of 16 sets, but we reserve one for our internal use, so we have 15
* left. */
#define MAX_SETS 15
#endif
/* MALI_RENDERER_STATE::sampler_count is 16-bit. */
#define MAX_PER_SET_SAMPLERS UINT16_MAX
@ -57,6 +52,27 @@
/* MALI_ATTRIBUTE::buffer_index is 9-bit, and each image takes two
* MALI_ATTRIBUTE_BUFFER slots, which gives a maximum of (1 << 8) images. */
#define MAX_PER_SET_STORAGE_IMAGES (1 << 8)
#else
/* Valhall has native support for descriptor sets, and allows a maximum
* of 16 sets, but we reserve one for our internal use, so we have 15
* left. */
#define MAX_SETS 15
/* Hardware limit is 2^24 each of buffer, texture, and sampler descriptors. We
* use the same hardware descriptors for multiple kinds of vulkan descriptors,
* and may want to reorganize these in the future, so advertise a lower limit
* of 2^20. */
#define MAX_DESCRIPTORS (1 << 20)
#define MAX_PER_SET_SAMPLERS MAX_DESCRIPTORS
#define MAX_PER_SET_SAMPLED_IMAGES MAX_DESCRIPTORS
#define MAX_PER_SET_UNIFORM_BUFFERS MAX_DESCRIPTORS
#define MAX_PER_SET_STORAGE_BUFFERS MAX_DESCRIPTORS
#define MAX_PER_SET_STORAGE_IMAGES MAX_DESCRIPTORS
#endif
/* A maximum of 8 color render targets, and one depth-stencil render target. */
#define MAX_PER_SET_INPUT_ATTACHMENTS (MAX_RTS + 1)

View file

@ -28,6 +28,7 @@ extern const struct vk_device_shader_ops panvk_per_arch(device_shader_ops);
#define MAX_VS_ATTRIBS 16
#if PAN_ARCH <= 7
/* We could theoretically use the MAX_PER_SET values here (except for UBOs
* where we're really limited to 256 on the shader side), but on Bifrost we
@ -39,6 +40,18 @@ extern const struct vk_device_shader_ops panvk_per_arch(device_shader_ops);
#define MAX_PER_STAGE_STORAGE_BUFFERS 64
#define MAX_PER_STAGE_STORAGE_IMAGES 32
#define MAX_PER_STAGE_INPUT_ATTACHMENTS MAX_PER_SET_INPUT_ATTACHMENTS
#else
#define MAX_PER_STAGE_SAMPLED_IMAGES MAX_PER_SET_SAMPLED_IMAGES
#define MAX_PER_STAGE_SAMPLERS MAX_PER_SET_SAMPLERS
#define MAX_PER_STAGE_UNIFORM_BUFFERS MAX_PER_SET_UNIFORM_BUFFERS
#define MAX_PER_STAGE_STORAGE_BUFFERS MAX_PER_SET_STORAGE_BUFFERS
#define MAX_PER_STAGE_STORAGE_IMAGES MAX_PER_SET_STORAGE_IMAGES
#define MAX_PER_STAGE_INPUT_ATTACHMENTS MAX_PER_SET_INPUT_ATTACHMENTS
#endif
#define MAX_PER_STAGE_RESOURCES ( \
MAX_PER_STAGE_SAMPLED_IMAGES + MAX_PER_STAGE_SAMPLERS + \
MAX_PER_STAGE_UNIFORM_BUFFERS + MAX_PER_STAGE_STORAGE_BUFFERS + \