From b68d4c0c48f63317696458da48b113d43438c189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 10 Jul 2026 10:34:24 +0200 Subject: [PATCH] Work around problem with clashing uniform precision in thin3d presets. See #21904 Fixes #21904 --- Common/GPU/thin3d.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Common/GPU/thin3d.cpp b/Common/GPU/thin3d.cpp index 49afb2b971..5a8bc6f22a 100644 --- a/Common/GPU/thin3d.cpp +++ b/Common/GPU/thin3d.cpp @@ -264,7 +264,11 @@ static ShaderModule *GenerateFShader(DrawContext *draw, FragmentShaderPreset pre const bool rbSwizzle = preset == FS_TEXTURE_COLOR_2D_RB_SWIZZLE; fsWriter.DeclareSamplers(g_samplers); - fsWriter.BeginFSMain(g_uniforms, texturing ? Slice(g_varyingsTex) : Slice(g_varyings)); + + // NOTE (first argument): We do not declare the uniforms here, as they aren't used in any of the preset shaders. + // Declaring them currently causes a precision clash with some GLSL compilers, see issue #21904. + // So if we need them in the future, that needs to be dealt with. + fsWriter.BeginFSMain(Slice::empty(), texturing ? Slice(g_varyingsTex) : Slice(g_varyings)); if (texturing) { fsWriter.C("vec4 col = "); fsWriter.SampleTexture2D("tex", "oTexCoord0");