Commit bcb8dd74 authored by Alejandro Piñeiro's avatar Alejandro Piñeiro Committed by Marge Bot

broadcom/common: increase V3D_MAX_TEXTURE_SAMPLERS, add specific OpenGL limit

This is needed due Vulkan because by spec (31.1. Limit Requirements)
the minimum value for the following limits are the following ones:
  maxPerStageDescriptorSampledImages 16
  maxPerStageDescriptorStorageImages  4
  maxPerStageDescriptorInputAttachments 4

And we are using v3d textures for all of them, so current limit would
not be enough for some cases.

Note that as the current comment explains there is not exactly a HW
limit for it, so we could bump to 32 for example, but let's just be
conservative and ask the minimum required.

It is worth to note that we needed to maintain the same value for the
OpenGL case, as it gets a register allocation failure on some GL
cases. We tried to fix that with small changes on the nir scheduler,
but we found that it would require some non-trivial effort to get it
done (that eventually we would need to).

Fixes tests like:
dEQP-VK.binding_model.descriptorset_random.sets16.constant.ubolimitlow.sbolimitlow.imglimitlow.noiub.uab.comp.noia.0

v2: keep the previous limit for Opengl (Eric)
Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
Part-of: <!6999>
parent 5f7810dc
......@@ -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
......
......@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment