diff --git a/GPU/Common/VertexDecoderCommon.cpp b/GPU/Common/VertexDecoderCommon.cpp index c055c3a3d2..243300e457 100644 --- a/GPU/Common/VertexDecoderCommon.cpp +++ b/GPU/Common/VertexDecoderCommon.cpp @@ -1320,6 +1320,10 @@ void VertexDecoder::DecodeVerts(u8 *decodedptr, const void *verts, const UVScale int count = indexUpperBound - indexLowerBound + 1; int stride = decFmt.stride; +#ifdef _DEBUG + decodedCount += count; +#endif + // Check alignment before running the decoder, as we may crash if it's bad (as should the real PSP but doesn't always) if (((uintptr_t)verts & (biggest - 1)) != 0) { // Bad alignment. Not really sure what to do here... zero the verts to be safe? @@ -1475,7 +1479,7 @@ static const char * const colnames[8] = { "", "?", "?", "?", "565", "5551", "444 int VertexDecoder::ToString(char *output, bool spaces) const { char *start = output; - + output += sprintf(output, "[%08x] ", fmt_); output += sprintf(output, "P: %s ", posnames[pos]); if (nrm) output += sprintf(output, "N: %s ", nrmnames[nrm]); @@ -1502,6 +1506,10 @@ int VertexDecoder::ToString(char *output, bool spaces) const { } } +#ifdef _DEBUG + output += sprintf(output, " (%llu)", (long long)decodedCount); +#endif + return output - start; } diff --git a/GPU/Common/VertexDecoderCommon.h b/GPU/Common/VertexDecoderCommon.h index c5a72a7b41..65d0b56d0f 100644 --- a/GPU/Common/VertexDecoderCommon.h +++ b/GPU/Common/VertexDecoderCommon.h @@ -475,6 +475,10 @@ public: u8 biggest; // in practice, alignment. +#ifdef _DEBUG + mutable u64 decodedCount = 0; +#endif + friend class VertexDecoderJitCache; private: diff --git a/GPU/Common/VertexDecoderHandwritten.cpp b/GPU/Common/VertexDecoderHandwritten.cpp index 07de5fa90d..890399ac57 100644 --- a/GPU/Common/VertexDecoderHandwritten.cpp +++ b/GPU/Common/VertexDecoderHandwritten.cpp @@ -16,12 +16,30 @@ #endif #endif - // Candidates for hand-writing // (found using our custom Very Sleepy). // GPU::P:_f_N:_s8_C:_8888_T:_u16__(24b)_040001BE (5%+ of God of War execution) // GPU::P:_f_N:_s8_C:_8888_T:_u16_W:_f_(1x)__(28b)_040007BE (1%+ of God of War execution) +// Tekken 6: +// (found using the vertex counter that's active in _DEBUG) +// [04000111] P: s16 C: 565 T: u8 (10b) (736949) // Also in Midnight Club + +// Wipeout Pure: +// [0400013f] P: s16 N: s8 C: 8888 T: f (24b) (1495430) + +// Flatout: +// [04000122] P: s16 N: s8 T: u16 (14b) (3901754) +// [04000116] P: s16 C: 5551 T: u16 (12b) (2225841) + +// Test drive: +// [05000100] P: s16 (6b) (2827872) +// [050011ff] P: f N: f C: 8888 T: f I: u16 (36b) (3812112) + +// Burnout Dominator: +// [04000122] P: s16 N: s8 T: u16 (14b) (1710813) +// [04000116] P: s16 C: 5551 T: u16 (12b) (7688298) + // This is the first GoW one. void VtxDec_Tu16_C8888_Pfloat(const u8 *srcp, u8 *dstp, int count, const UVScale *uvScaleOffset) { struct GOWVTX {