From 8d8491df5e91b831bbd475073744575312776a07 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Wed, 13 Jul 2022 09:05:01 +0200 Subject: [PATCH] v3d: stop using a smaller texture limit in OpenGL MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Part-of: --- src/broadcom/ci/broadcom-rpi4-fails.txt | 8 ++++++++ src/broadcom/common/v3d_limits.h | 16 +--------------- src/gallium/drivers/v3d/v3d_screen.c | 2 +- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/broadcom/ci/broadcom-rpi4-fails.txt b/src/broadcom/ci/broadcom-rpi4-fails.txt index 9dc6898..f5d0d54 100644 --- a/src/broadcom/ci/broadcom-rpi4-fails.txt +++ b/src/broadcom/ci/broadcom-rpi4-fails.txt @@ -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 diff --git a/src/broadcom/common/v3d_limits.h b/src/broadcom/common/v3d_limits.h index 7a35b9a..eba8942 100644 --- a/src/broadcom/common/v3d_limits.h +++ b/src/broadcom/common/v3d_limits.h @@ -36,21 +36,7 @@ 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 diff --git a/src/gallium/drivers/v3d/v3d_screen.c b/src/gallium/drivers/v3d/v3d_screen.c index 0c74d8e..0a42300 100644 --- a/src/gallium/drivers/v3d/v3d_screen.c +++ b/src/gallium/drivers/v3d/v3d_screen.c @@ -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) { -- 2.7.4