diff --git a/Core/HLE/sceDisplay.cpp b/Core/HLE/sceDisplay.cpp index 90c5f07de7cc..ce25a55351a1 100644 --- a/Core/HLE/sceDisplay.cpp +++ b/Core/HLE/sceDisplay.cpp @@ -918,7 +918,7 @@ u32 sceDisplaySetFramebuf(u32 topaddr, int linesize, int pixelformat, int sync) u64 now = CoreTiming::GetTicks(); s64 cyclesAhead = nextFlipCycles - now; if (cyclesAhead > FLIP_DELAY_CYCLES_MIN) { - if (lastFlipsTooFrequent >= FLIP_DELAY_MIN_FLIPS) { + if (lastFlipsTooFrequent >= FLIP_DELAY_MIN_FLIPS && gpuStats.numClears > 0) { delayCycles = cyclesAhead; } else { ++lastFlipsTooFrequent; diff --git a/GPU/Common/FramebufferCommon.cpp b/GPU/Common/FramebufferCommon.cpp index 522c704a5f30..d9e2d029ad90 100644 --- a/GPU/Common/FramebufferCommon.cpp +++ b/GPU/Common/FramebufferCommon.cpp @@ -1297,6 +1297,9 @@ bool FramebufferManagerCommon::NotifyFramebufferCopy(u32 src, u32 dst, int size, } return false; } else if (dstBuffer) { + if (isMemset) { + gpuStats.numClears++; + } WARN_LOG_ONCE(btucpy, G3D, "Memcpy fbo upload %08x -> %08x", src, dst); if (g_Config.bBlockTransferGPU) { FlushBeforeCopy(); diff --git a/GPU/Common/SoftwareTransformCommon.cpp b/GPU/Common/SoftwareTransformCommon.cpp index c92b9b9131fb..a29c987c11de 100644 --- a/GPU/Common/SoftwareTransformCommon.cpp +++ b/GPU/Common/SoftwareTransformCommon.cpp @@ -408,6 +408,7 @@ void SoftwareTransform( // Need to rescale from a [0, 1] float. This is the final transformed value. result->depth = ToScaledDepth((s16)(int)(transformed[1].z * 65535.0f)); result->action = SW_CLEAR; + gpuStats.numClears++; return; } } @@ -560,5 +561,9 @@ void SoftwareTransform( } } + if (gstate.isModeClear()) { + gpuStats.numClears++; + } + result->action = SW_DRAW_PRIMITIVES; } diff --git a/GPU/D3D11/GPU_D3D11.cpp b/GPU/D3D11/GPU_D3D11.cpp index 6fae0890526d..df3a9aa6f1ae 100644 --- a/GPU/D3D11/GPU_D3D11.cpp +++ b/GPU/D3D11/GPU_D3D11.cpp @@ -518,7 +518,7 @@ void GPU_D3D11::GetStats(char *buffer, size_t bufsize) { float vertexAverageCycles = gpuStats.numVertsSubmitted > 0 ? (float)gpuStats.vertexGPUCycles / (float)gpuStats.numVertsSubmitted : 0.0f; snprintf(buffer, bufsize - 1, "DL processing time: %0.2f ms\n" - "Draw calls: %i, flushes %i\n" + "Draw calls: %i, flushes %i, clears %i\n" "Cached Draw calls: %i\n" "Num Tracked Vertex Arrays: %i\n" "GPU cycles executed: %d (%f per vertex)\n" @@ -532,6 +532,7 @@ void GPU_D3D11::GetStats(char *buffer, size_t bufsize) { gpuStats.msProcessingDisplayLists * 1000.0f, gpuStats.numDrawCalls, gpuStats.numFlushes, + gpuStats.numClears, gpuStats.numCachedDrawCalls, gpuStats.numTrackedVertexArrays, gpuStats.vertexGPUCycles + gpuStats.otherGPUCycles, diff --git a/GPU/Directx9/GPU_DX9.cpp b/GPU/Directx9/GPU_DX9.cpp index 4afaa7238a59..fb071c7a50c5 100644 --- a/GPU/Directx9/GPU_DX9.cpp +++ b/GPU/Directx9/GPU_DX9.cpp @@ -492,7 +492,7 @@ void GPU_DX9::GetStats(char *buffer, size_t bufsize) { float vertexAverageCycles = gpuStats.numVertsSubmitted > 0 ? (float)gpuStats.vertexGPUCycles / (float)gpuStats.numVertsSubmitted : 0.0f; snprintf(buffer, bufsize - 1, "DL processing time: %0.2f ms\n" - "Draw calls: %i, flushes %i\n" + "Draw calls: %i, flushes %i, clears %i\n" "Cached Draw calls: %i\n" "Num Tracked Vertex Arrays: %i\n" "GPU cycles executed: %d (%f per vertex)\n" @@ -506,6 +506,7 @@ void GPU_DX9::GetStats(char *buffer, size_t bufsize) { gpuStats.msProcessingDisplayLists * 1000.0f, gpuStats.numDrawCalls, gpuStats.numFlushes, + gpuStats.numClears, gpuStats.numCachedDrawCalls, gpuStats.numTrackedVertexArrays, gpuStats.vertexGPUCycles + gpuStats.otherGPUCycles, diff --git a/GPU/GLES/GPU_GLES.cpp b/GPU/GLES/GPU_GLES.cpp index 8142419e9767..eecabf5bfa6b 100644 --- a/GPU/GLES/GPU_GLES.cpp +++ b/GPU/GLES/GPU_GLES.cpp @@ -693,7 +693,7 @@ void GPU_GLES::GetStats(char *buffer, size_t bufsize) { float vertexAverageCycles = gpuStats.numVertsSubmitted > 0 ? (float)gpuStats.vertexGPUCycles / (float)gpuStats.numVertsSubmitted : 0.0f; snprintf(buffer, bufsize - 1, "DL processing time: %0.2f ms\n" - "Draw calls: %i, flushes %i\n" + "Draw calls: %i, flushes %i, clears %i\n" "Cached Draw calls: %i\n" "Num Tracked Vertex Arrays: %i\n" "GPU cycles executed: %d (%f per vertex)\n" @@ -707,6 +707,7 @@ void GPU_GLES::GetStats(char *buffer, size_t bufsize) { gpuStats.msProcessingDisplayLists * 1000.0f, gpuStats.numDrawCalls, gpuStats.numFlushes, + gpuStats.numClears, gpuStats.numCachedDrawCalls, gpuStats.numTrackedVertexArrays, gpuStats.vertexGPUCycles + gpuStats.otherGPUCycles, diff --git a/GPU/GPU.h b/GPU/GPU.h index b10bf19d9aea..7e10db49aaf9 100644 --- a/GPU/GPU.h +++ b/GPU/GPU.h @@ -68,6 +68,7 @@ struct GPUStatistics { numFlushes = 0; numTexturesDecoded = 0; numReadbacks = 0; + numClears = 0; msProcessingDisplayLists = 0; vertexGPUCycles = 0; otherGPUCycles = 0; @@ -87,6 +88,7 @@ struct GPUStatistics { int numShaderSwitches; int numTexturesDecoded; int numReadbacks; + int numClears; double msProcessingDisplayLists; int vertexGPUCycles; int otherGPUCycles; diff --git a/GPU/Vulkan/GPU_Vulkan.cpp b/GPU/Vulkan/GPU_Vulkan.cpp index e2015c32d5b4..76e1b881b906 100644 --- a/GPU/Vulkan/GPU_Vulkan.cpp +++ b/GPU/Vulkan/GPU_Vulkan.cpp @@ -656,7 +656,7 @@ void GPU_Vulkan::GetStats(char *buffer, size_t bufsize) { float vertexAverageCycles = gpuStats.numVertsSubmitted > 0 ? (float)gpuStats.vertexGPUCycles / (float)gpuStats.numVertsSubmitted : 0.0f; snprintf(buffer, bufsize - 1, "DL processing time: %0.2f ms\n" - "Draw calls: %i, flushes %i\n" + "Draw calls: %i, flushes %i, clears %i\n" "Cached Draw calls: %i\n" "Num Tracked Vertex Arrays: %i\n" "GPU cycles executed: %d (%f per vertex)\n" @@ -672,6 +672,7 @@ void GPU_Vulkan::GetStats(char *buffer, size_t bufsize) { gpuStats.msProcessingDisplayLists * 1000.0f, gpuStats.numDrawCalls, gpuStats.numFlushes, + gpuStats.numClears, gpuStats.numCachedDrawCalls, gpuStats.numTrackedVertexArrays, gpuStats.vertexGPUCycles + gpuStats.otherGPUCycles,