Inline SetupVertexDecoder() in SubmitPrim().

Everything SubmitPrim() calls is expensive...
This commit is contained in:
Unknown W. Brackets 2014-04-05 01:25:04 -07:00
parent d8df88bc1f
commit bb2fb12edd
2 changed files with 7 additions and 2 deletions

View File

@ -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);

View File

@ -124,6 +124,7 @@ public:
void ClearTrackedVertexArrays();
void SetupVertexDecoder(u32 vertType);
inline void SetupVertexDecoderInternal(u32 vertType);
// This requires a SetupVertexDecoder call first.
int EstimatePerVertexCost() {