From bb05409c16886d2d883b68a1b4d1eca8fe1cd4a4 Mon Sep 17 00:00:00 2001 From: S2S <12202580+standard-two-simplex@users.noreply.github.com> Date: Fri, 13 Nov 2020 21:42:27 +0100 Subject: [PATCH] Disable clamping for special textures --- .../glsl_CombinerProgramUniformFactory.cpp | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramUniformFactory.cpp b/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramUniformFactory.cpp index 9d6a7f3e..fefae5bb 100644 --- a/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramUniformFactory.cpp +++ b/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramUniformFactory.cpp @@ -974,12 +974,12 @@ public: void update(bool _force) override { - std::array aTexWrap[2] = { {0.0f,0.0f}, {0.0f,0.0f} }; - std::array aTexClamp[2] = { { 0.0f,0.0f },{ 0.0f,0.0f } }; - std::array aTexWrapEn[2] = { { 0.0f,0.0f },{ 0.0f,0.0f } }; - std::array aTexClampEn[2] = { { 0.0f,0.0f },{ 0.0f,0.0f } }; - std::array aTexMirrorEn[2] = { { 0.0f,0.0f },{ 0.0f,0.0f } }; - std::array aTexSize[2] = { { 0.0f,0.0f },{ 0.0f,0.0f } }; + std::array aTexWrap[2] = { { 1024.0f, 1024.0f }, { 1024.0f, 1024.0f } }; + std::array aTexClamp[2] = { { 1024.0f, 1024.0f }, { 1024.0f, 1024.0f } }; + std::array aTexWrapEn[2] = { { 0.0f, 0.0f }, { 0.0f, 0.0f } }; + std::array aTexClampEn[2] = { { 0.0f, 0.0f }, { 0.0f, 0.0f } }; + std::array aTexMirrorEn[2] = { { 0.0f, 0.0f }, { 0.0f,0.0f }}; + std::array aTexSize[2] = { { 1024.0f, 1024.0f }, { 1024.0f, 1024.0f } }; TextureCache & cache = textureCache(); const bool replaceTex1ByTex0 = needReplaceTex1ByTex0(); @@ -997,12 +997,8 @@ public: aTexSize[t][1] = pTexture->height * pTexture->hdRatioT; /* Not sure if special treatment of framebuffer textures is correct */ - if (pTexture->frameBufferTexture != CachedTexture::fbNone || - pTile->textureMode != TEXTUREMODE_NORMAL || - g_debugger.isDebugMode()) + if (pTexture->frameBufferTexture != CachedTexture::fbNone) { - aTexWrap[t][0] = pTexture->hdRatioS; - aTexWrap[t][1] = pTexture->hdRatioT; aTexClamp[t][0] = f32(pTexture->width) * pTexture->hdRatioS - 1.0f; aTexClamp[t][1] = f32(pTexture->height) * pTexture->hdRatioT - 1.0f; aTexWrapEn[t][0] = 0.0; @@ -1011,6 +1007,13 @@ public: aTexClampEn[t][1] = 1.0; aTexMirrorEn[t][0] = 0.0; aTexMirrorEn[t][1] = 0.0; + } else if (pTile->textureMode != TEXTUREMODE_NORMAL || g_debugger.isDebugMode()) { + aTexWrapEn[t][0] = 0.0; + aTexWrapEn[t][1] = 0.0; + aTexClampEn[t][0] = 0.0; + aTexClampEn[t][1] = 0.0; + aTexMirrorEn[t][0] = 0.0; + aTexMirrorEn[t][1] = 0.0; } else { aTexWrap[t][0] = f32(1 << pTile->masks) * pTexture->hdRatioS; aTexWrap[t][1] = f32(1 << pTile->maskt) * pTexture->hdRatioT;