From 2bca62b26ef0199aec791aa36b2107dfdd5e4135 Mon Sep 17 00:00:00 2001 From: raven02 Date: Mon, 11 Nov 2013 21:12:43 +0800 Subject: [PATCH] Don't reset texture width/height unless the size is different --- GPU/GLES/GLES_GPU.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/GPU/GLES/GLES_GPU.cpp b/GPU/GLES/GLES_GPU.cpp index b1f359c88d..84ca8c4368 100644 --- a/GPU/GLES/GLES_GPU.cpp +++ b/GPU/GLES/GLES_GPU.cpp @@ -1042,9 +1042,15 @@ void GLES_GPU::ExecuteOpInternal(u32 op, u32 diff) { } case GE_CMD_TEXSIZE0: - gstate_c.curTextureWidth = gstate.getTextureWidth(0); - gstate_c.curTextureHeight = gstate.getTextureHeight(0); - shaderManager_->DirtyUniform(DIRTY_UVSCALEOFFSET); + // Render to texture may have overridden the width/height. + // Don't reset it unless the size is different / the texture has changed. + if (diff || gstate_c.textureChanged) { + gstate_c.curTextureWidth = gstate.getTextureWidth(0); + gstate_c.curTextureHeight = gstate.getTextureHeight(0); + shaderManager_->DirtyUniform(DIRTY_UVSCALEOFFSET); + // We will need to reset the texture now. + gstate_c.textureChanged = true; + } //fall thru - ignoring the mipmap sizes for now case GE_CMD_TEXSIZE1: @@ -1054,7 +1060,8 @@ void GLES_GPU::ExecuteOpInternal(u32 op, u32 diff) { case GE_CMD_TEXSIZE5: case GE_CMD_TEXSIZE6: case GE_CMD_TEXSIZE7: - gstate_c.textureChanged = true; + if (diff) + gstate_c.textureChanged = true; break; case GE_CMD_ZBUFPTR: