gl: use textureProj for palette texture sampling when possible/available

Fixes UV precision issue when doing the Z-divide manually.
Issue #1804
This commit is contained in:
Flyinghead 2025-01-21 18:18:05 +01:00
parent 5efdf58e85
commit 5b513cac5b
1 changed files with 5 additions and 3 deletions

View File

@ -202,10 +202,12 @@ lowp vec4 getPaletteEntry(highp float colorIndex)
lowp vec4 palettePixel(highp vec3 coords)
{
#if TARGET_GL != GLES2 && TARGET_GL != GL2 && DIV_POS_Z != 1
coords.xy /= coords.z;
#endif
#if TARGET_GL == GLES2 || TARGET_GL == GL2 || DIV_POS_Z == 1
return getPaletteEntry(texture(tex, coords.xy).FOG_CHANNEL);
#else
return getPaletteEntry(textureProj(tex, coords).FOG_CHANNEL);
#endif
}
#elif pp_Palette == 2 // Bi-linear filtering