v3d/v3dv: use common compute limits

Move the compute workgroup count and shared memory limits shared by
v3d and v3dv to v3d_limits.h.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41791>
This commit is contained in:
Lishin 2026-05-25 23:02:17 +01:00
parent af8c3eb3d6
commit c41f88fb35
3 changed files with 9 additions and 4 deletions

View file

@ -69,6 +69,9 @@
#define V3D_MAX_ARRAY_LAYERS 2048
#define V3D_MAX_COMPUTE_SHARED_MEMORY_SIZE (32u * 1024u)
#define V3D_MAX_CSD_WG_COUNT 65535
#define V3D_MAX_CSD_WG_SIZE 256
#define V3D_MAX_VERTEX_ATTRIB_DIVISOR 0xffff

View file

@ -1027,8 +1027,10 @@ get_device_properties(const struct v3dv_physical_device *device,
MAX_STORAGE_IMAGES,
/* Compute limits */
.maxComputeSharedMemorySize = 32u * 1024u,
.maxComputeWorkGroupCount = { 65535, 65535, 65535 },
.maxComputeSharedMemorySize = V3D_MAX_COMPUTE_SHARED_MEMORY_SIZE,
.maxComputeWorkGroupCount = { V3D_MAX_CSD_WG_COUNT,
V3D_MAX_CSD_WG_COUNT,
V3D_MAX_CSD_WG_COUNT },
.maxComputeWorkGroupInvocations = V3D_MAX_CSD_WG_SIZE,
.maxComputeWorkGroupSize = { V3D_MAX_CSD_WG_SIZE,
V3D_MAX_CSD_WG_SIZE,

View file

@ -202,7 +202,7 @@ v3d_init_compute_caps(struct v3d_screen *screen)
*/
caps->max_grid_size[0] =
caps->max_grid_size[1] =
caps->max_grid_size[2] = 65535;
caps->max_grid_size[2] = V3D_MAX_CSD_WG_COUNT;
/* GL_MAX_COMPUTE_WORK_GROUP_SIZE */
caps->max_block_size[0] =
@ -216,7 +216,7 @@ v3d_init_compute_caps(struct v3d_screen *screen)
caps->max_variable_threads_per_block = V3D_MAX_CSD_WG_SIZE;
/* GL_MAX_COMPUTE_SHARED_MEMORY_SIZE */
caps->max_local_size = 32768;
caps->max_local_size = V3D_MAX_COMPUTE_SHARED_MEMORY_SIZE;
struct sysinfo si;
sysinfo(&si);