diff --git a/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramBuilderAccurate.cpp b/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramBuilderAccurate.cpp index 1b6fc75d..ead9a1f3 100644 --- a/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramBuilderAccurate.cpp +++ b/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramBuilderAccurate.cpp @@ -90,7 +90,6 @@ public: m_part = "IN highp vec4 aRectPosition; \n" "IN highp vec2 aTexCoord0; \n" - "IN highp vec2 aTexCoord1; \n" "IN highp vec2 aBaryCoords; \n" " \n" "OUT highp vec2 vTexCoord; \n" diff --git a/src/GraphicsDrawer.cpp b/src/GraphicsDrawer.cpp index 7b303023..215acec6 100644 --- a/src/GraphicsDrawer.cpp +++ b/src/GraphicsDrawer.cpp @@ -1275,10 +1275,16 @@ void GraphicsDrawer::drawTexturedRect(const TexturedRectParams & _params) offsetY = (_params.lry - _params.uly) * _params.dtdy; } - for (u32 t = 0; t < 2; ++t) { - if (pCurrentCombiner->usesTile(t) && cache.current[t] && gSP.textureTile[t]) { - - if (config.generalEmulation.enableInaccurateTextureCoordinates) { + if (config.generalEmulation.enableInaccurateTextureCoordinates == 0u) { + // Accurate texture path + texST[0].s0 = _FIXED2FLOAT(_params.s, 5); + texST[0].s1 = texST[0].s0 + offsetX; + texST[0].t0 = _FIXED2FLOAT(_params.t, 5); + texST[0].t1 = texST[0].t0 + offsetY; + } else { + // Fast texture path + for (u32 t = 0; t < 2; ++t) { + if (pCurrentCombiner->usesTile(t) && cache.current[t] && gSP.textureTile[t]) { f32 shiftScaleS = 1.0f; f32 shiftScaleT = 1.0f; @@ -1303,43 +1309,7 @@ void GraphicsDrawer::drawTexturedRect(const TexturedRectParams & _params) texST[t].s1 = cache.current[t]->offsetS + texST[t].s1; texST[t].t1 = cache.current[t]->offsetT + texST[t].t1; } - } else { - const f32 uls = _FIXED2FLOAT(_params.s, 5); - const f32 lrs = uls + offsetX; - const f32 ult = _FIXED2FLOAT(_params.t, 5); - const f32 lrt = ult + offsetY; - texST[t].s0 = uls; - texST[t].s1 = lrs; - texST[t].t0 = ult; - texST[t].t1 = lrt; - } - - if (cache.current[t]->frameBufferTexture != CachedTexture::fbMultiSample) { - Context::TexParameters texParams; - - if ((cache.current[t]->mirrorS == 0 && cache.current[t]->maskS == 0 && - (texST[t].s0 < texST[t].s1 ? - texST[t].s0 >= 0.0f && texST[t].s1 <= static_cast(cache.current[t]->width) : - texST[t].s1 >= 0.0f && texST[t].s0 <= static_cast(cache.current[t]->width))) - || (cache.current[t]->maskS == 0 && (texST[t].s0 < -1024.0f || texST[t].s1 > 1023.99f))) - texParams.wrapS = textureParameters::WRAP_CLAMP_TO_EDGE; - - if (cache.current[t]->mirrorT == 0 && - (texST[t].t0 < texST[t].t1 ? - texST[t].t0 >= 0.0f && texST[t].t1 <= static_cast(cache.current[t]->height) : - texST[t].t1 >= 0.0f && texST[t].t0 <= static_cast(cache.current[t]->height))) - texParams.wrapT = textureParameters::WRAP_CLAMP_TO_EDGE; - - if (texParams.wrapS.isValid() || texParams.wrapT.isValid()) { - texParams.handle = cache.current[t]->name; - texParams.target = textureTarget::TEXTURE_2D; - texParams.textureUnitIndex = textureIndices::Tex[t]; - gfxContext.setTextureParameters(texParams); - } - } - - if (config.generalEmulation.enableInaccurateTextureCoordinates) { texST[t].s0 *= cache.current[t]->scaleS; texST[t].t0 *= cache.current[t]->scaleT; texST[t].s1 *= cache.current[t]->scaleS;