Work around problem with clashing uniform precision in thin3d presets.

See #21904

Fixes #21904
This commit is contained in:
Henrik Rydgård
2026-07-10 10:34:24 +02:00
parent 78f80a0010
commit b68d4c0c48
+5 -1
View File
@@ -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<UniformDef>::empty(), texturing ? Slice(g_varyingsTex) : Slice(g_varyings));
if (texturing) {
fsWriter.C("vec4 col = ");
fsWriter.SampleTexture2D("tex", "oTexCoord0");