From e63bb0459c817e4d0add5c8ccd197746f4d288ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 2 Oct 2023 17:28:25 +0200 Subject: [PATCH] Add a new stat, so we can see per game if the optimization has an effect --- GPU/D3D11/DrawEngineD3D11.cpp | 1 + GPU/Directx9/DrawEngineDX9.cpp | 1 + GPU/GLES/DrawEngineGLES.cpp | 1 + GPU/GPU.h | 2 ++ GPU/GPUCommonHW.cpp | 3 ++- GPU/Vulkan/DrawEngineVulkan.cpp | 1 + 6 files changed, 8 insertions(+), 1 deletion(-) diff --git a/GPU/D3D11/DrawEngineD3D11.cpp b/GPU/D3D11/DrawEngineD3D11.cpp index 3711fee648..0deb056ef4 100644 --- a/GPU/D3D11/DrawEngineD3D11.cpp +++ b/GPU/D3D11/DrawEngineD3D11.cpp @@ -727,6 +727,7 @@ rotateVBO: gpuStats.numFlushes++; gpuStats.numDrawCalls += numDrawInds_; + gpuStats.numVertexDecodes += numDrawVerts_; gpuStats.numVertsSubmitted += vertexCountInDrawCalls_; indexGen.Reset(); diff --git a/GPU/Directx9/DrawEngineDX9.cpp b/GPU/Directx9/DrawEngineDX9.cpp index 890daa4cc2..276fde10a3 100644 --- a/GPU/Directx9/DrawEngineDX9.cpp +++ b/GPU/Directx9/DrawEngineDX9.cpp @@ -668,6 +668,7 @@ rotateVBO: gpuStats.numFlushes++; gpuStats.numDrawCalls += numDrawInds_; + gpuStats.numVertexDecodes += numDrawVerts_; gpuStats.numVertsSubmitted += vertexCountInDrawCalls_; // TODO: The below should be shared. diff --git a/GPU/GLES/DrawEngineGLES.cpp b/GPU/GLES/DrawEngineGLES.cpp index c202eb3634..9949d0c37b 100644 --- a/GPU/GLES/DrawEngineGLES.cpp +++ b/GPU/GLES/DrawEngineGLES.cpp @@ -475,6 +475,7 @@ void DrawEngineGLES::DoFlush() { bail: gpuStats.numFlushes++; gpuStats.numDrawCalls += numDrawInds_; + gpuStats.numVertexDecodes += numDrawVerts_; gpuStats.numVertsSubmitted += vertexCountInDrawCalls_; // TODO: When the next flush has the same vertex format, we can continue with the same offset in the vertex buffer, diff --git a/GPU/GPU.h b/GPU/GPU.h index 9e9dd6049a..5db94e2d39 100644 --- a/GPU/GPU.h +++ b/GPU/GPU.h @@ -75,6 +75,7 @@ struct GPUStatistics { void ResetFrame() { numDrawCalls = 0; + numVertexDecodes = 0; numDrawSyncs = 0; numListSyncs = 0; numCachedDrawCalls = 0; @@ -111,6 +112,7 @@ struct GPUStatistics { // Per frame statistics int numDrawCalls; + int numVertexDecodes; int numDrawSyncs; int numListSyncs; int numCachedDrawCalls; diff --git a/GPU/GPUCommonHW.cpp b/GPU/GPUCommonHW.cpp index a9b5ded875..544f1c58cc 100644 --- a/GPU/GPUCommonHW.cpp +++ b/GPU/GPUCommonHW.cpp @@ -1647,7 +1647,7 @@ size_t GPUCommonHW::FormatGPUStatsCommon(char *buffer, size_t size) { float vertexAverageCycles = gpuStats.numVertsSubmitted > 0 ? (float)gpuStats.vertexGPUCycles / (float)gpuStats.numVertsSubmitted : 0.0f; return snprintf(buffer, size, "DL processing time: %0.2f ms, %d drawsync, %d listsync\n" - "Draw calls: %d, flushes %d, clears %d, bbox jumps %d (%d updates)\n" + "Draw: %d (%d dec), flushes %d, clears %d, bbox jumps %d (%d updates)\n" "Cached draws: %d (tracked: %d)\n" "Vertices: %d cached: %d uncached: %d\n" "FBOs active: %d (evaluations: %d)\n" @@ -1660,6 +1660,7 @@ size_t GPUCommonHW::FormatGPUStatsCommon(char *buffer, size_t size) { gpuStats.numDrawSyncs, gpuStats.numListSyncs, gpuStats.numDrawCalls, + gpuStats.numVertexDecodes, gpuStats.numFlushes, gpuStats.numClears, gpuStats.numBBOXJumps, diff --git a/GPU/Vulkan/DrawEngineVulkan.cpp b/GPU/Vulkan/DrawEngineVulkan.cpp index 2a463fb9e0..ed83c7f207 100644 --- a/GPU/Vulkan/DrawEngineVulkan.cpp +++ b/GPU/Vulkan/DrawEngineVulkan.cpp @@ -1016,6 +1016,7 @@ void DrawEngineVulkan::DoFlush() { gpuStats.numFlushes++; gpuStats.numDrawCalls += numDrawInds_; + gpuStats.numVertexDecodes += numDrawVerts_; gpuStats.numVertsSubmitted += vertexCountInDrawCalls_; indexGen.Reset();