mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 05:19:56 +00:00
Show statistics for GPU cycles executed per frame.
This commit is contained in:
parent
58c992d3d0
commit
9c85bd92e4
@ -254,6 +254,8 @@ void __DisplayGetDebugStats(char stats[2048])
|
||||
{
|
||||
gpu->UpdateStats();
|
||||
|
||||
float vertexAverageCycles = gpuStats.numVertsSubmitted > 0 ? (float)gpuStats.vertexGPUCycles / (float)gpuStats.numVertsSubmitted : 0.0f;
|
||||
|
||||
sprintf(stats,
|
||||
"Frames: %i\n"
|
||||
"DL processing time: %0.2f ms\n"
|
||||
@ -263,6 +265,7 @@ void __DisplayGetDebugStats(char stats[2048])
|
||||
"Draw calls: %i, flushes %i\n"
|
||||
"Cached Draw calls: %i\n"
|
||||
"Num Tracked Vertex Arrays: %i\n"
|
||||
"Cycles executed: %d (%f per vertex)\n"
|
||||
"Vertices Submitted: %i\n"
|
||||
"Cached Vertices Drawn: %i\n"
|
||||
"Uncached Vertices Drawn: %i\n"
|
||||
@ -283,6 +286,8 @@ void __DisplayGetDebugStats(char stats[2048])
|
||||
gpuStats.numFlushes,
|
||||
gpuStats.numCachedDrawCalls,
|
||||
gpuStats.numTrackedVertexArrays,
|
||||
gpuStats.vertexGPUCycles + gpuStats.otherGPUCycles,
|
||||
vertexAverageCycles,
|
||||
gpuStats.numVertsSubmitted,
|
||||
gpuStats.numCachedVertsDrawn,
|
||||
gpuStats.numUncachedVertsDrawn,
|
||||
|
@ -390,6 +390,7 @@ void GLES_GPU::ExecuteOp(u32 op, u32 diff) {
|
||||
transformDraw_.SubmitPrim(verts, inds, type, count, gstate.vertType, -1, &bytesRead);
|
||||
|
||||
int vertexCost = transformDraw_.EstimatePerVertexCost();
|
||||
gpuStats.vertexGPUCycles += vertexCost * count;
|
||||
cyclesExecuted += vertexCost * count;
|
||||
|
||||
// After drawing, we advance the vertexAddr (when non indexed) or indexAddr (when indexed).
|
||||
|
@ -463,6 +463,7 @@ inline void GPUCommon::UpdatePC(u32 currentPC, u32 newPC)
|
||||
{
|
||||
// Rough estimate, 2 CPU ticks (it's double the clock rate) per GPU instruction.
|
||||
cyclesExecuted += 2 * (currentPC - cycleLastPC) / 4;
|
||||
gpuStats.otherGPUCycles += 2 * (currentPC - cycleLastPC) / 4;
|
||||
cycleLastPC = newPC == 0 ? currentPC : newPC;
|
||||
|
||||
// Exit the runloop and recalculate things. This isn't common.
|
||||
|
@ -302,6 +302,8 @@ struct GPUStatistics
|
||||
numFlushes = 0;
|
||||
numTexturesDecoded = 0;
|
||||
msProcessingDisplayLists = 0;
|
||||
vertexGPUCycles = 0;
|
||||
otherGPUCycles = 0;
|
||||
}
|
||||
|
||||
// Per frame statistics
|
||||
@ -317,6 +319,8 @@ struct GPUStatistics
|
||||
int numShaderSwitches;
|
||||
int numTexturesDecoded;
|
||||
double msProcessingDisplayLists;
|
||||
int vertexGPUCycles;
|
||||
int otherGPUCycles;
|
||||
|
||||
// Total statistics, updated by the GPU core in UpdateStats
|
||||
int numFrames;
|
||||
|
Loading…
Reference in New Issue
Block a user