diff --git a/src/broadcom/common/v3d_limits.h b/src/broadcom/common/v3d_limits.h index e02582035f1..66b1fcc5b5f 100644 --- a/src/broadcom/common/v3d_limits.h +++ b/src/broadcom/common/v3d_limits.h @@ -36,10 +36,21 @@ V3D_MAX_GS_INPUTS, \ V3D_MAX_FS_INPUTS) +/* For now we need to maintain a different limits for OpenGL and Vulkan due + * some OpenGL CTS tests hitting register allocation when trying to use all + * the texture available. + * + * FIXME: nir_schedule should be able to handle that. When fixed it would be + * simpler to keep just one limit + */ +#define V3D_VULKAN_MAX_TEXTURE_SAMPLERS 24 +#define V3D_OPENGL_MAX_TEXTURE_SAMPLERS 16 + /* Not specifically a hardware limit, just coordination between compiler and * driver. */ -#define V3D_MAX_TEXTURE_SAMPLERS 16 +#define V3D_MAX_TEXTURE_SAMPLERS MAX2(V3D_VULKAN_MAX_TEXTURE_SAMPLERS, \ + V3D_OPENGL_MAX_TEXTURE_SAMPLERS) /* The HW can do 16384 (15), but we run into hangs when we expose that. */ #define V3D_MAX_MIP_LEVELS 13 diff --git a/src/gallium/drivers/v3d/v3d_screen.c b/src/gallium/drivers/v3d/v3d_screen.c index 63309e9c8d1..e45a684117e 100644 --- a/src/gallium/drivers/v3d/v3d_screen.c +++ b/src/gallium/drivers/v3d/v3d_screen.c @@ -387,7 +387,7 @@ v3d_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader, return 0; case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS: case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS: - return V3D_MAX_TEXTURE_SAMPLERS; + return V3D_OPENGL_MAX_TEXTURE_SAMPLERS; case PIPE_SHADER_CAP_MAX_SHADER_BUFFERS: if (screen->has_cache_flush) {