From 1e1979b786a62b9df1750ed62d83d4fa9f540238 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 12 Feb 2013 00:02:53 -0800 Subject: [PATCH] Simply don't cache < 100 verts for now. Fixes wrong vertexes in a number of games. --- GPU/GLES/TransformPipeline.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/GPU/GLES/TransformPipeline.cpp b/GPU/GLES/TransformPipeline.cpp index a82441285e..c4eccd5725 100644 --- a/GPU/GLES/TransformPipeline.cpp +++ b/GPU/GLES/TransformPipeline.cpp @@ -936,12 +936,6 @@ void TransformDrawEngine::Flush() { } if (vai->drawsUntilNextFullHash == 0) { u32 newHash = ComputeHash(); - // exponential backoff up to 16 draws, then every 24 - vai->drawsUntilNextFullHash = std::min(24, vai->numFrames); - // TODO: tweak - //if (vai->numFrames > 1000) { - // vai->status = VertexArrayInfo::VAI_RELIABLE; - //} if (newHash != vai->hash) { vai->status = VertexArrayInfo::VAI_UNRELIABLE; if (vai->vbo) { @@ -955,6 +949,17 @@ void TransformDrawEngine::Flush() { DecodeVerts(); goto rotateVBO; } + if (vai->numVerts > 100) { + // exponential backoff up to 16 draws, then every 24 + vai->drawsUntilNextFullHash = std::min(24, vai->numFrames); + } else { + // Lower numbers seem much more likely to change. + vai->status = VertexArrayInfo::VAI_UNRELIABLE; + } + // TODO: tweak + //if (vai->numFrames > 1000) { + // vai->status = VertexArrayInfo::VAI_RELIABLE; + //} } else { vai->drawsUntilNextFullHash--; // TODO: "mini-hashing" the first 32 bytes of the vertex/index data or something.