diff --git a/GPU/GLES/Framebuffer.cpp b/GPU/GLES/Framebuffer.cpp index 72b8cc13d1..84f65d646c 100644 --- a/GPU/GLES/Framebuffer.cpp +++ b/GPU/GLES/Framebuffer.cpp @@ -660,7 +660,7 @@ void FramebufferManager::DestroyFramebuf(VirtualFramebuffer *v) { delete v; } -void FramebufferManager::SetRenderFrameBuffer() { +void FramebufferManager::DoSetRenderFrameBuffer() { if (!gstate_c.framebufChanged && currentRenderVfb_) { currentRenderVfb_->last_frame_render = gpuStats.numFlips; currentRenderVfb_->dirtyAfterDisplay = true; diff --git a/GPU/GLES/Framebuffer.h b/GPU/GLES/Framebuffer.h index 10350c8c1c..2aa9157b9f 100644 --- a/GPU/GLES/Framebuffer.h +++ b/GPU/GLES/Framebuffer.h @@ -135,7 +135,18 @@ public: void Resized(); void DeviceLost(); void CopyDisplayToOutput(); - void SetRenderFrameBuffer(); // Uses parameters computed from gstate + void DoSetRenderFrameBuffer(); // Uses parameters computed from gstate + void SetRenderFrameBuffer() { + // Inlining this part since it's so frequent. + if (!gstate_c.framebufChanged && currentRenderVfb_) { + currentRenderVfb_->last_frame_render = gpuStats.numFlips; + currentRenderVfb_->dirtyAfterDisplay = true; + if (!gstate_c.skipDrawReason) + currentRenderVfb_->reallyDirtyAfterDisplay = true; + return; + } + DoSetRenderFrameBuffer(); + } void UpdateFromMemory(u32 addr, int size, bool safe); void SetLineWidth(); diff --git a/GPU/GLES/TransformPipeline.cpp b/GPU/GLES/TransformPipeline.cpp index 79eac24228..d7b6932672 100644 --- a/GPU/GLES/TransformPipeline.cpp +++ b/GPU/GLES/TransformPipeline.cpp @@ -267,35 +267,6 @@ void TransformDrawEngine::SetupVertexDecoder(u32 vertType) { } } -int TransformDrawEngine::EstimatePerVertexCost() { - // TODO: This is transform cost, also account for rasterization cost somehow... although it probably - // runs in parallel with transform. - - // Also, this is all pure guesswork. If we can find a way to do measurements, that would be great. - - // GTA wants a low value to run smooth, GoW wants a high value (otherwise it thinks things - // went too fast and starts doing all the work over again). - - int cost = 20; - if (gstate.isLightingEnabled()) { - cost += 10; - - for (int i = 0; i < 4; i++) { - if (gstate.isLightChanEnabled(i)) - cost += 10; - } - } - - if (gstate.getUVGenMode() != GE_TEXMAP_TEXTURE_COORDS) { - cost += 20; - } - if (dec_ && dec_->morphcount > 1) { - cost += 5 * dec_->morphcount; - } - - return cost; -} - void TransformDrawEngine::SubmitPrim(void *verts, void *inds, GEPrimitiveType prim, int vertexCount, u32 vertType, int *bytesRead) { if (vertexCount == 0) return; // we ignore zero-sized draw calls. diff --git a/GPU/GLES/TransformPipeline.h b/GPU/GLES/TransformPipeline.h index 40d35fed56..c0c146cbda 100644 --- a/GPU/GLES/TransformPipeline.h +++ b/GPU/GLES/TransformPipeline.h @@ -21,6 +21,7 @@ #include "GPU/Common/GPUDebugInterface.h" #include "GPU/Common/IndexGenerator.h" +#include "GPU/GLES/VertexDecoder.h" #include "gfx/gl_common.h" #include "gfx/gl_lost_manager.h" @@ -28,8 +29,6 @@ class LinkedShader; class ShaderManager; class TextureCache; class FramebufferManager; -class VertexDecoder; -class VertexDecoderJitCache; struct TransformedVertex; struct DecVtxFormat; @@ -127,7 +126,34 @@ public: void SetupVertexDecoder(u32 vertType); // This requires a SetupVertexDecoder call first. - int EstimatePerVertexCost(); + int EstimatePerVertexCost() { + // TODO: This is transform cost, also account for rasterization cost somehow... although it probably + // runs in parallel with transform. + + // Also, this is all pure guesswork. If we can find a way to do measurements, that would be great. + + // GTA wants a low value to run smooth, GoW wants a high value (otherwise it thinks things + // went too fast and starts doing all the work over again). + + int cost = 20; + if (gstate.isLightingEnabled()) { + cost += 10; + + for (int i = 0; i < 4; i++) { + if (gstate.isLightChanEnabled(i)) + cost += 10; + } + } + + if (gstate.getUVGenMode() != GE_TEXMAP_TEXTURE_COORDS) { + cost += 20; + } + if (dec_ && dec_->morphcount > 1) { + cost += 5 * dec_->morphcount; + } + + return cost; + } // So that this can be inlined void Flush() {