From b81359ec841724dd447fc450025605c9f3cdfb2e Mon Sep 17 00:00:00 2001 From: Caterina Shablia Date: Tue, 27 May 2025 20:05:19 +0000 Subject: [PATCH] panvk: bump maxPushConstantSize to 256 Vulkan 1.4 raises the minimum for maxPushConstantSize to 256, and given that we intend on supporting 1.4 eventually and the change is very simple might as well do it now. Reviewed-by: Olivia Lee Reviewed-by: Boris Brezillon Part-of: --- src/panfrost/vulkan/panvk_cmd_push_constant.h | 2 +- src/panfrost/vulkan/panvk_physical_device.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/panfrost/vulkan/panvk_cmd_push_constant.h b/src/panfrost/vulkan/panvk_cmd_push_constant.h index bf94369b734..faa03299365 100644 --- a/src/panfrost/vulkan/panvk_cmd_push_constant.h +++ b/src/panfrost/vulkan/panvk_cmd_push_constant.h @@ -13,7 +13,7 @@ struct panvk_cmd_buffer; struct panvk_shader; -#define MAX_PUSH_CONSTANTS_SIZE 128 +#define MAX_PUSH_CONSTANTS_SIZE 256 struct panvk_push_constant_state { uint64_t data[MAX_PUSH_CONSTANTS_SIZE / sizeof(uint64_t)]; diff --git a/src/panfrost/vulkan/panvk_physical_device.c b/src/panfrost/vulkan/panvk_physical_device.c index a32561743bf..51e6b8cb3ee 100644 --- a/src/panfrost/vulkan/panvk_physical_device.c +++ b/src/panfrost/vulkan/panvk_physical_device.c @@ -711,10 +711,13 @@ get_device_properties(const struct panvk_instance *instance, * descriptors, where the size is a 32-bit field. */ .maxStorageBufferRange = UINT32_MAX, - /* 128 bytes of push constants, so we're aligned with the minimum Vulkan - * requirements. + /* Vulkan 1.4 minimum. We currently implement push constants in terms of + * FAUs so we're limited by how many user-defined FAUs the hardware + * offers, minus driver-internal needs. If we ever need go to higher, + * we'll have to implement push constants in terms of both FAUs and global + * loads. */ - .maxPushConstantsSize = 128, + .maxPushConstantsSize = 256, /* On our kernel drivers we're limited by the available memory rather * than available allocations. This is better expressed through memory * properties and budget queries, and by returning