From b12621e3f00a832a8f18c0b5e6ae5c4a99d03b61 Mon Sep 17 00:00:00 2001 From: gigaherz Date: Fri, 8 Aug 2008 23:22:27 +0000 Subject: [PATCH] Some more changes to the statistics. Commented out all currently unused stats, and implemented counting primitives in DL in a "hacky" way. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@158 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Plugin_VideoOGL/Src/OpcodeDecoding.cpp | 17 ++++++++++- Source/Plugins/Plugin_VideoOGL/Src/Render.cpp | 30 ++++++++++--------- 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/OpcodeDecoding.cpp b/Source/Plugins/Plugin_VideoOGL/Src/OpcodeDecoding.cpp index 3ba94e841b..650d58aa7c 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/OpcodeDecoding.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/OpcodeDecoding.cpp @@ -43,6 +43,14 @@ extern int FAKE_GetFifoSize(); CDataReader_Fifo g_fifoReader; +template +void Xchg(T& a, T&b) +{ + T c = a; + a = b; + b = c; +} + void ExecuteDisplayList(u32 address, u32 size) { IDataReader* pOldReader = g_pDataReader; @@ -51,11 +59,18 @@ void ExecuteDisplayList(u32 address, u32 size) CDataReader_Memory memoryReader(address); g_pDataReader = &memoryReader; + // temporarily swap dl and non-dl(small "hack" for the stats) + Xchg(stats.thisFrame.numDLPrims,stats.thisFrame.numPrims); + while((memoryReader.GetReadAddress() - address) < size) { Decode(); } - INCSTAT(stats.numDListsAlive); + INCSTAT(stats.numDListsCalled); + + // un-swap + Xchg(stats.thisFrame.numDLPrims,stats.thisFrame.numPrims); + // reset to the old reader g_pDataReader = pOldReader; } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index 46e607f754..e333f6f6f5 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -671,21 +671,23 @@ void Renderer::Swap(const TRectangle& rc) p+=sprintf(p,"Num pshaders alive: %i\n",stats.numPixelShadersAlive); p+=sprintf(p,"Num vshaders created: %i\n",stats.numVertexShadersCreated); p+=sprintf(p,"Num vshaders alive: %i\n",stats.numVertexShadersAlive); - p+=sprintf(p,"Num dlists called: %i\n",stats.numDListsCalled); - p+=sprintf(p,"Num dlists created: %i\n",stats.numDListsCreated); - p+=sprintf(p,"Num dlists alive: %i\n",stats.numDListsAlive); - p+=sprintf(p,"Num strip joins: %i\n",stats.numJoins); - p+=sprintf(p,"Num primitives: %i\n",stats.thisFrame.numPrims); - p+=sprintf(p,"Num primitives (DL): %i\n",stats.thisFrame.numDLPrims); - p+=sprintf(p,"Num bad commands: %i%s\n",stats.thisFrame.numBadCommands,stats.thisFrame.numBadCommands?"!!!":""); - p+=sprintf(p,"Num XF loads: %i\n",stats.thisFrame.numXFLoads); - p+=sprintf(p,"Num XF loads (DL): %i\n",stats.thisFrame.numXFLoadsInDL); - p+=sprintf(p,"Num CP loads: %i\n",stats.thisFrame.numCPLoads); - p+=sprintf(p,"Num CP loads (DL): %i\n",stats.thisFrame.numCPLoadsInDL); - p+=sprintf(p,"Num BP loads: %i\n",stats.thisFrame.numBPLoads); - p+=sprintf(p,"Num BP loads (DL): %i\n",stats.thisFrame.numBPLoadsInDL); + p+=sprintf(p,"Num dlists called: %i\n",stats.numDListsCalled); + // not used. + //p+=sprintf(p,"Num dlists created: %i\n",stats.numDListsCreated); + //p+=sprintf(p,"Num dlists alive: %i\n",stats.numDListsAlive); + //p+=sprintf(p,"Num strip joins: %i\n",stats.numJoins); + p+=sprintf(p,"Num primitives: %i\n",stats.thisFrame.numPrims); + p+=sprintf(p,"Num primitives (DL): %i\n",stats.thisFrame.numDLPrims); + p+=sprintf(p,"Num bad commands: %i%s\n",stats.thisFrame.numBadCommands,stats.thisFrame.numBadCommands?"!!!":""); + // not used. + //p+=sprintf(p,"Num XF loads: %i\n",stats.thisFrame.numXFLoads); + //p+=sprintf(p,"Num XF loads (DL): %i\n",stats.thisFrame.numXFLoadsInDL); + //p+=sprintf(p,"Num CP loads: %i\n",stats.thisFrame.numCPLoads); + //p+=sprintf(p,"Num CP loads (DL): %i\n",stats.thisFrame.numCPLoadsInDL); + //p+=sprintf(p,"Num BP loads: %i\n",stats.thisFrame.numBPLoads); + //p+=sprintf(p,"Num BP loads (DL): %i\n",stats.thisFrame.numBPLoadsInDL); - Renderer::DrawText(st, 20, 20, 0xFF00FFFF); + Renderer::DrawText(st, 20, 20, 0xFF00FFFF); } #if defined(DVPROFILE)