From d27ce4781ff2b75e1e19ce793a39d57f15602e5f Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Wed, 17 Mar 2021 22:29:34 +0700 Subject: [PATCH] Fix calculation of clamping parameters for texture engine: use integer part of tile coordinates to calculate tile dimensions. Fixed texture glitches io topgear overdrive, #2464 --- .../OpenGLContext/GLSL/glsl_CombinerProgramUniformFactory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramUniformFactory.cpp b/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramUniformFactory.cpp index 62cce334..d3efd7ad 100644 --- a/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramUniformFactory.cpp +++ b/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramUniformFactory.cpp @@ -1015,8 +1015,8 @@ public: } else { aTexWrap[t][0] = f32(1 << pTile->masks) * pTexture->hdRatioS; aTexWrap[t][1] = f32(1 << pTile->maskt) * pTexture->hdRatioT; - aTexClamp[t][0] = (pTile->flrs - pTile->fuls + 1.0f) * pTexture->hdRatioS - 1.0f; - aTexClamp[t][1] = (pTile->flrt - pTile->fult + 1.0f) * pTexture->hdRatioT - 1.0f; + aTexClamp[t][0] = f32(pTile->lrs - pTile->uls + 1) * pTexture->hdRatioS - 1.0f; + aTexClamp[t][1] = f32(pTile->lrt - pTile->ult + 1) * pTexture->hdRatioT - 1.0f; aTexWrapEn[t][0] = f32(pTile->masks == 0 ? 0 : 1); aTexWrapEn[t][1] = f32(pTile->maskt == 0 ? 0 : 1); aTexClampEn[t][0] = f32(gDP.otherMode.cycleType == G_CYC_COPY ? 0 : (pTile->masks == 0 ? 1 : pTile->clamps));