panvk: Allow more descriptor sets on Valhall

The hardware limit on Valhall is 16 descriptor tables, but we reserve
one for our internal descriptors (dummy sampler, vertex attributes and
dynamic buffers), which leaves us with 15 user descriptor sets.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30736>
This commit is contained in:
Boris Brezillon 2024-06-28 11:43:15 +02:00 committed by Marge Bot
parent 5571a4cdaa
commit b1db49d078
2 changed files with 13 additions and 9 deletions

View file

@ -19,7 +19,7 @@
#include "genxml/gen_macros.h"
#define PANVK_DESCRIPTOR_SIZE 32
#define MAX_SETS 4
#define MAX_SETS (PAN_ARCH <= 7 ? 4 : 15)
#define MAX_DYNAMIC_UNIFORM_BUFFERS 16
#define MAX_DYNAMIC_STORAGE_BUFFERS 8
#define MAX_PUSH_DESCS 32

View file

@ -249,7 +249,7 @@ get_device_properties(const struct panvk_instance *instance,
uint64_t os_page_size = 4096;
os_get_page_size(&os_page_size);
ASSERTED unsigned arch = pan_arch(device->kmod.props.gpu_prod_id);
unsigned arch = pan_arch(device->kmod.props.gpu_prod_id);
/* Ensure that the max threads count per workgroup is valid for Bifrost */
assert(arch > 8 || device->kmod.props.max_threads_per_wg <= 1024);
@ -298,14 +298,18 @@ get_device_properties(const struct panvk_instance *instance,
.bufferImageGranularity = 64,
/* Sparse binding not supported yet. */
.sparseAddressSpaceSize = 0,
/* Software limit. Pick the minimum required by Vulkan, because Bifrost
* GPUs don't have unified descriptor tables, which forces us to
* agregatte all descriptors from all sets and dispatch them to per-type
* descriptor tables emitted at draw/dispatch time.
* The more sets we support the more copies we are likely to have to do
* at draw time.
/* 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 agregatte all descriptors from all sets and dispatch
* them to per-type descriptor tables emitted at draw/dispatch time. The
* more sets we support the more copies we are likely to have to do at
* draw time.
*
* 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.
*/
.maxBoundDescriptorSets = 4,
.maxBoundDescriptorSets = arch <= 7 ? 4 : 15,
/* MALI_RENDERER_STATE::sampler_count is 16-bit. */
.maxDescriptorSetSamplers = UINT16_MAX,
/* MALI_RENDERER_STATE::uniform_buffer_count is 8-bit. We reserve 32 slots