From 2f72da8087acfd67b6fe73b53605c9132abf3b6f Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 13 Apr 2014 13:01:18 -0700 Subject: [PATCH] Don't dirty the texture on texmapenable. Tales of Phantasia X flips on and off texturing during battle transitions. This causes tons of needless rehashes. --- GPU/GLES/GLES_GPU.cpp | 4 ++-- GPU/GLES/StateMapping.cpp | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/GPU/GLES/GLES_GPU.cpp b/GPU/GLES/GLES_GPU.cpp index ea7b6d8e37..fec550719c 100644 --- a/GPU/GLES/GLES_GPU.cpp +++ b/GPU/GLES/GLES_GPU.cpp @@ -115,7 +115,7 @@ static const CommandTableEntry commandTable[] = { // These affect the fragment shader so need flushing. {GE_CMD_CLEARMODE, FLAG_FLUSHBEFOREONCHANGE}, - {GE_CMD_TEXTUREMAPENABLE, FLAG_FLUSHBEFOREONCHANGE | FLAG_EXECUTEONCHANGE}, + {GE_CMD_TEXTUREMAPENABLE, FLAG_FLUSHBEFOREONCHANGE}, {GE_CMD_FOGENABLE, FLAG_FLUSHBEFOREONCHANGE}, {GE_CMD_TEXMODE, FLAG_FLUSHBEFOREONCHANGE | FLAG_EXECUTEONCHANGE}, {GE_CMD_TEXSHADELS, FLAG_FLUSHBEFOREONCHANGE}, @@ -918,7 +918,7 @@ void GLES_GPU::ExecuteOpInternal(u32 op, u32 diff) { break; case GE_CMD_TEXTUREMAPENABLE: - gstate_c.textureChanged = true; + // Don't need to dirty the texture here, already dirtied at list start/etc. break; case GE_CMD_LIGHTINGENABLE: diff --git a/GPU/GLES/StateMapping.cpp b/GPU/GLES/StateMapping.cpp index 179039094f..9e8a6f1e4a 100644 --- a/GPU/GLES/StateMapping.cpp +++ b/GPU/GLES/StateMapping.cpp @@ -166,10 +166,8 @@ static inline bool blendColorSimilar(const Vec3f &a, const Vec3f &b, float margi void TransformDrawEngine::ApplyDrawState(int prim) { // TODO: All this setup is soon so expensive that we'll need dirty flags, or simply do it in the command writes where we detect dirty by xoring. Silly to do all this work on every drawcall. - if (gstate_c.textureChanged && !gstate.isModeClear()) { - if (gstate.isTextureMapEnabled()) { - textureCache_->SetTexture(); - } + if (gstate_c.textureChanged && !gstate.isModeClear() && gstate.isTextureMapEnabled()) { + textureCache_->SetTexture(); gstate_c.textureChanged = false; }