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
This commit is contained in:
gigaherz 2008-08-08 23:22:27 +00:00
parent 8731021466
commit b12621e3f0
2 changed files with 32 additions and 15 deletions

View File

@ -43,6 +43,14 @@ extern int FAKE_GetFifoSize();
CDataReader_Fifo g_fifoReader;
template <class T>
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;
}

View File

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