From c3ba5effe2e0eb568635e38030f254fa5c4ea2f7 Mon Sep 17 00:00:00 2001 From: Jose Maria Casanova Crespo Date: Wed, 29 Apr 2026 23:43:28 +0200 Subject: [PATCH] v3d/v3dv: Use new V3D_MAX_CSD_WG_SIZE = 256 Reviewed-by: Iago Toral Quiroga Part-of: --- src/broadcom/common/v3d_limits.h | 2 ++ src/broadcom/vulkan/v3dv_device.c | 8 +++++--- src/gallium/drivers/v3d/v3d_screen.c | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/broadcom/common/v3d_limits.h b/src/broadcom/common/v3d_limits.h index 157b73700cc..34d1345cfbe 100644 --- a/src/broadcom/common/v3d_limits.h +++ b/src/broadcom/common/v3d_limits.h @@ -69,6 +69,8 @@ #define V3D_MAX_ARRAY_LAYERS 2048 +#define V3D_MAX_CSD_WG_SIZE 256 + #define V3D_MAX_VERTEX_ATTRIB_DIVISOR 0xffff /* Tile allocation block sizes for the PTB, as enum values matching diff --git a/src/broadcom/vulkan/v3dv_device.c b/src/broadcom/vulkan/v3dv_device.c index b9180486136..b540f1b3ed1 100644 --- a/src/broadcom/vulkan/v3dv_device.c +++ b/src/broadcom/vulkan/v3dv_device.c @@ -1022,8 +1022,10 @@ get_device_properties(const struct v3dv_physical_device *device, /* Compute limits */ .maxComputeSharedMemorySize = 32u * 1024u, .maxComputeWorkGroupCount = { 65535, 65535, 65535 }, - .maxComputeWorkGroupInvocations = 256, - .maxComputeWorkGroupSize = { 256, 256, 256 }, + .maxComputeWorkGroupInvocations = V3D_MAX_CSD_WG_SIZE, + .maxComputeWorkGroupSize = { V3D_MAX_CSD_WG_SIZE, + V3D_MAX_CSD_WG_SIZE, + V3D_MAX_CSD_WG_SIZE }, .subPixelPrecisionBits = V3D_COORD_SHIFT, .subTexelPrecisionBits = 8, @@ -1280,7 +1282,7 @@ get_device_properties(const struct v3dv_physical_device *device, /* VK_EXT_subgroup_size_control */ .minSubgroupSize = V3D_CHANNELS, .maxSubgroupSize = V3D_CHANNELS, - .maxComputeWorkgroupSubgroups = 16, /* 256 / 16 */ + .maxComputeWorkgroupSubgroups = V3D_MAX_CSD_WG_SIZE / V3D_CHANNELS, .requiredSubgroupSizeStages = VK_SHADER_STAGE_COMPUTE_BIT, /* VK_KHR_maintenance5 */ diff --git a/src/gallium/drivers/v3d/v3d_screen.c b/src/gallium/drivers/v3d/v3d_screen.c index ac7b2bf707c..f2a979ee9a6 100644 --- a/src/gallium/drivers/v3d/v3d_screen.c +++ b/src/gallium/drivers/v3d/v3d_screen.c @@ -207,13 +207,13 @@ v3d_init_compute_caps(struct v3d_screen *screen) /* GL_MAX_COMPUTE_WORK_GROUP_SIZE */ caps->max_block_size[0] = caps->max_block_size[1] = - caps->max_block_size[2] = 256; + caps->max_block_size[2] = V3D_MAX_CSD_WG_SIZE; /* GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS: This is * limited by WG_SIZE in the CSD. */ caps->max_threads_per_block = - caps->max_variable_threads_per_block = 256; + caps->max_variable_threads_per_block = V3D_MAX_CSD_WG_SIZE; /* GL_MAX_COMPUTE_SHARED_MEMORY_SIZE */ caps->max_local_size = 32768;