From df1a91ee2521edca49eb459858148cddb1bb2c8d Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 20 Feb 2022 10:25:00 -0800 Subject: [PATCH] samplerjit: Correct nearest negative texture clamp. Was not clamping to zero when negative. --- GPU/Software/SamplerX86.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GPU/Software/SamplerX86.cpp b/GPU/Software/SamplerX86.cpp index 9471ff61a5..415eed2723 100644 --- a/GPU/Software/SamplerX86.cpp +++ b/GPU/Software/SamplerX86.cpp @@ -2626,7 +2626,7 @@ bool SamplerJitCache::Jit_GetTexelCoords(const SamplerID &id) { CVTTPS2DQ(sReg, R(sReg)); regCache_.Release(sizesReg, RegCache::VEC_TEMP0); - PSRLD(sReg, 8); + PSRAD(sReg, 8); // Reuse tempXYReg for the level1 values. if (!cpu_info.bSSE4_1) @@ -2685,7 +2685,7 @@ bool SamplerJitCache::Jit_GetTexelCoords(const SamplerID &id) { MULPS(sReg, M(constWidthHeight256f_)); CVTTPS2DQ(sReg, R(sReg)); // Great, shift out the fraction. - PSRLD(sReg, 8); + PSRAD(sReg, 8); // Square textures are kinda common. bool clampApplied = false;