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

pull/3334/head
Stenzek 11 months ago
parent 0076af6974
commit 0ae8fcced3
No known key found for this signature in database

@ -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
uint2 icoord = ApplyTextureWindow(FloatToIntegerCoords(coords));
#if UPSCALED
float2 fpart = frac(coords);
coords = (float2(icoord) + fpart);
#else
// Drop fractional part.
coords = float2(icoord);
#endif
uint2 icoord = ApplyTextureWindow(FloatToIntegerCoords(coords));
coords = (float2(icoord) + fpart) * (1.0f / 256.0f);
// Normalize.
coords = coords * (1.0f / 256.0f);
return SAMPLE_TEXTURE(samp0, coords);
}

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

Loading…
Cancel
Save