From bb2fb12edd2b0a0aff4116420d254c56409c005e Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 5 Apr 2014 01:25:04 -0700 Subject: [PATCH] Inline SetupVertexDecoder() in SubmitPrim(). Everything SubmitPrim() calls is expensive... --- GPU/GLES/TransformPipeline.cpp | 8 ++++++-- GPU/GLES/TransformPipeline.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/GPU/GLES/TransformPipeline.cpp b/GPU/GLES/TransformPipeline.cpp index d7b6932672..951b9fc276 100644 --- a/GPU/GLES/TransformPipeline.cpp +++ b/GPU/GLES/TransformPipeline.cpp @@ -255,9 +255,13 @@ VertexDecoder *TransformDrawEngine::GetVertexDecoder(u32 vtype) { } void TransformDrawEngine::SetupVertexDecoder(u32 vertType) { + SetupVertexDecoderInternal(vertType); +} + +inline void TransformDrawEngine::SetupVertexDecoderInternal(u32 vertType) { // As the decoder depends on the UVGenMode when we use UV prescale, we simply mash it // into the top of the verttype where there are unused bits. - u32 vertTypeID = (vertType & 0xFFFFFF) | (gstate.getUVGenMode() << 24); + const u32 vertTypeID = (vertType & 0xFFFFFF) | (gstate.getUVGenMode() << 24); // If vtype has changed, setup the vertex decoder. // TODO: Simply cache the setup decoders instead. @@ -280,7 +284,7 @@ void TransformDrawEngine::SubmitPrim(void *verts, void *inds, GEPrimitiveType pr } prevPrim_ = prim; - SetupVertexDecoder(vertType); + SetupVertexDecoderInternal(vertType); dec_->IncrementStat(STAT_VERTSSUBMITTED, vertexCount); diff --git a/GPU/GLES/TransformPipeline.h b/GPU/GLES/TransformPipeline.h index c0c146cbda..4176168890 100644 --- a/GPU/GLES/TransformPipeline.h +++ b/GPU/GLES/TransformPipeline.h @@ -124,6 +124,7 @@ public: void ClearTrackedVertexArrays(); void SetupVertexDecoder(u32 vertType); + inline void SetupVertexDecoderInternal(u32 vertType); // This requires a SetupVertexDecoder call first. int EstimatePerVertexCost() {