GPU/HW: Fix incorrect sampling at 1x with TC

This commit is contained in:
Stenzek 2024-11-25 13:15:07 +10:00
parent 0076af6974
commit 0ae8fcced3
No known key found for this signature in database
2 changed files with 11 additions and 7 deletions

View File

@ -880,13 +880,17 @@ float4 SampleFromVRAM(TEXPAGE_VALUE texpage, float2 coords)
float4 SampleFromPageTexture(float2 coords)
{
// Cached textures.
#if UPSCALED == 0
float2 fpart = coords - roundEven(coords);
#else
float2 fpart = frac(coords);
#endif
uint2 icoord = ApplyTextureWindow(FloatToIntegerCoords(coords));
coords = (float2(icoord) + fpart) * (1.0f / 256.0f);
#if UPSCALED
float2 fpart = frac(coords);
coords = (float2(icoord) + fpart);
#else
// Drop fractional part.
coords = float2(icoord);
#endif
// Normalize.
coords = coords * (1.0f / 256.0f);
return SAMPLE_TEXTURE(samp0, coords);
}

View File

@ -5,4 +5,4 @@
#include "common/types.h"
static constexpr u32 SHADER_CACHE_VERSION = 20;
static constexpr u32 SHADER_CACHE_VERSION = 21;