diff --git a/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramUniformFactory.cpp b/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramUniformFactory.cpp index 43771cdd..73fe947d 100644 --- a/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramUniformFactory.cpp +++ b/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramUniformFactory.cpp @@ -1084,14 +1084,12 @@ public: uBilinearOffset.set(bilinearOffset, bilinearOffset, _force); TextureCache & cache = textureCache(); - const bool replaceTex1ByTex0 = needReplaceTex1ByTex0(); for (u32 t = 0; t < 2; ++t) { if (!m_useTile[t]) continue; - const u32 tile = replaceTex1ByTex0 ? 0 : t; - const gDPTile * pTile = gSP.textureTile[tile]; - CachedTexture * pTexture = cache.current[tile]; + const gDPTile * pTile = gSP.textureTile[t]; + CachedTexture * pTexture = cache.current[t]; if (pTile == nullptr || pTexture == nullptr) continue; diff --git a/src/Textures.cpp b/src/Textures.cpp index 0a79d0d1..6ceb507e 100644 --- a/src/Textures.cpp +++ b/src/Textures.cpp @@ -1562,14 +1562,6 @@ void TextureCache::update(u32 _t) return; } - if (_t == 1 && needReplaceTex1ByTex0()) { - current[1] = current[0]; - if (current[1] != nullptr) { - activateTexture(1, current[1]); - return; - } - } - if (gSP.texture.tile == 7 && _t == 0 && gSP.textureTile[0] == gDP.loadTile && @@ -1691,9 +1683,4 @@ void getTextureShiftScale(u32 t, const TextureCache & cache, f32 & shiftScaleS, shiftScaleT = (f32)(1 << (16 - gSP.textureTile[t]->shiftt)); else if (gSP.textureTile[t]->shiftt > 0) shiftScaleT /= (f32)(1 << gSP.textureTile[t]->shiftt); -} - -bool needReplaceTex1ByTex0() -{ - return gSP.texture.level == 0 && gDP.otherMode.textureLOD == G_TL_LOD && gDP.otherMode.textureDetail == G_TD_CLAMP; -} +} \ No newline at end of file diff --git a/src/Textures.h b/src/Textures.h index ff996dcc..a77be8b9 100644 --- a/src/Textures.h +++ b/src/Textures.h @@ -112,9 +112,6 @@ private: void getTextureShiftScale(u32 tile, const TextureCache & cache, f32 & shiftScaleS, f32 & shiftScaleT); -// Check for situation when Tex0 is used instead of Tex1 -bool needReplaceTex1ByTex0(); - inline TextureCache & textureCache() { return TextureCache::get(); diff --git a/src/gDP.cpp b/src/gDP.cpp index b56abf06..abb1c055 100644 --- a/src/gDP.cpp +++ b/src/gDP.cpp @@ -858,7 +858,7 @@ void gDPTextureRectangle(f32 ulx, f32 uly, f32 lrx, f32 lry, s32 tile, s16 s, s1 textureTileOrg[0] = gSP.textureTile[0]; textureTileOrg[1] = gSP.textureTile[1]; gSP.textureTile[0] = &gDP.tiles[tile]; - gSP.textureTile[1] = needReplaceTex1ByTex0() ? &gDP.tiles[tile] : &gDP.tiles[(tile + 1) & 7]; + gSP.textureTile[1] = &gDP.tiles[(tile + 1) & 7]; // HACK ALERT! if (s == 0x4000 && (gDP.colorImage.width + gSP.textureTile[0]->uls < 512)) @@ -973,7 +973,7 @@ void LLETriangle::start(u32 _tile) m_textureScaleOrg[1] = gSP.texture.scalet; gSP.texture.tile = _tile; gSP.textureTile[0] = &gDP.tiles[_tile]; - gSP.textureTile[1] = needReplaceTex1ByTex0() ? &gDP.tiles[_tile] : &gDP.tiles[(_tile + 1) & 7]; + gSP.textureTile[1] = &gDP.tiles[(_tile + 1) & 7]; gSP.texture.scales = 1.0f; gSP.texture.scalet = 1.0f; m_flushed = false;