v3d: stop using a smaller texture limit in OpenGL
authorIago Toral Quiroga <itoral@igalia.com>
Wed, 13 Jul 2022 07:05:01 +0000 (09:05 +0200)
committerMarge Bot <emma+marge@anholt.net>
Wed, 13 Jul 2022 10:09:34 +0000 (10:09 +0000)
The compiler has improved significantly since we found this issue
and this is no longer required.

Notice that because we are increasing the number of samplers
supported beyond what we can loop unroll (currently capped at 16),
some piglit tests that test the maximum number of samplers supported
start to fail because they use indirect indexing on a sampler array
and we don't support that (previously the indirect indexing was
removed by loop unrolling). This is a bug in tests which the
GLSL linker detects, failing to compile the shaders.

Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17509>

src/broadcom/ci/broadcom-rpi4-fails.txt
src/broadcom/common/v3d_limits.h
src/gallium/drivers/v3d/v3d_screen.c

index 9dc6898..f5d0d54 100644 (file)
@@ -353,3 +353,11 @@ spec@!opengl 1.0@depth-clear-precision-check@depth24,Fail
 # https://gitlab.khronos.org/Tracker/vk-gl-cts/-/issues/3711
 dEQP-VK.rasterization.rasterization_order_attachment_access.depth.samples_1.multi_draw_barriers,Fail
 dEQP-VK.rasterization.rasterization_order_attachment_access.depth.samples_4.multi_draw_barriers,Fail
+
+# These fail because the shaders use indirect indexing on samplers which we
+# don't support (the GLSL linker fails to link the shaders because of this).
+# If loop unrolling kicks-in for these tests it removes the indirect indexing
+# and the tests pass, but this would just be working around an issue in the
+# tests.
+spec@!opengl 2.0@max-samplers,Fail
+spec@!opengl 2.0@max-samplers border,Fail
index 7a35b9a..eba8942 100644 (file)
                                       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 MAX2(V3D_VULKAN_MAX_TEXTURE_SAMPLERS, \
-                                      V3D_OPENGL_MAX_TEXTURE_SAMPLERS)
+#define V3D_MAX_TEXTURE_SAMPLERS 24
 
 #define V3D_MAX_SAMPLES 4
 
index 0c74d8e..0a42300 100644 (file)
@@ -441,7 +441,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_OPENGL_MAX_TEXTURE_SAMPLERS;
+                return V3D_MAX_TEXTURE_SAMPLERS;
 
         case PIPE_SHADER_CAP_MAX_SHADER_BUFFERS:
                 if (screen->has_cache_flush) {