From 05fa667d036b0e2aeec71c4c51cff9687de6f477 Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Mon, 4 Mar 2019 01:25:33 +0000 Subject: [PATCH] VideoCommon: add EFB peek/poke stats --- Source/Core/VideoCommon/AsyncRequests.cpp | 5 +++++ Source/Core/VideoCommon/Statistics.cpp | 2 ++ Source/Core/VideoCommon/Statistics.h | 3 +++ 3 files changed, 10 insertions(+) diff --git a/Source/Core/VideoCommon/AsyncRequests.cpp b/Source/Core/VideoCommon/AsyncRequests.cpp index e5d0bb3c27..28769925c9 100644 --- a/Source/Core/VideoCommon/AsyncRequests.cpp +++ b/Source/Core/VideoCommon/AsyncRequests.cpp @@ -7,6 +7,7 @@ #include "VideoCommon/AsyncRequests.h" #include "VideoCommon/Fifo.h" #include "VideoCommon/RenderBase.h" +#include "VideoCommon/Statistics.h" #include "VideoCommon/VertexManagerBase.h" #include "VideoCommon/VideoBackendBase.h" #include "VideoCommon/VideoCommon.h" @@ -117,6 +118,7 @@ void AsyncRequests::HandleEvent(const AsyncRequests::Event& e) { case Event::EFB_POKE_COLOR: { + INCSTAT(stats.thisFrame.numEFBPokes); EfbPokeData poke = {e.efb_poke.x, e.efb_poke.y, e.efb_poke.data}; g_renderer->PokeEFB(EFBAccessType::PokeColor, &poke, 1); } @@ -124,17 +126,20 @@ void AsyncRequests::HandleEvent(const AsyncRequests::Event& e) case Event::EFB_POKE_Z: { + INCSTAT(stats.thisFrame.numEFBPokes); EfbPokeData poke = {e.efb_poke.x, e.efb_poke.y, e.efb_poke.data}; g_renderer->PokeEFB(EFBAccessType::PokeZ, &poke, 1); } break; case Event::EFB_PEEK_COLOR: + INCSTAT(stats.thisFrame.numEFBPeeks); *e.efb_peek.data = g_renderer->AccessEFB(EFBAccessType::PeekColor, e.efb_peek.x, e.efb_peek.y, 0); break; case Event::EFB_PEEK_Z: + INCSTAT(stats.thisFrame.numEFBPeeks); *e.efb_peek.data = g_renderer->AccessEFB(EFBAccessType::PeekZ, e.efb_peek.x, e.efb_peek.y, 0); break; diff --git a/Source/Core/VideoCommon/Statistics.cpp b/Source/Core/VideoCommon/Statistics.cpp index af122bfcdb..716dee4f73 100644 --- a/Source/Core/VideoCommon/Statistics.cpp +++ b/Source/Core/VideoCommon/Statistics.cpp @@ -85,6 +85,8 @@ void Statistics::Display() DRAW_STAT("Index streamed", "%i kB", stats.thisFrame.bytesIndexStreamed / 1024); DRAW_STAT("Uniform streamed", "%i kB", stats.thisFrame.bytesUniformStreamed / 1024); DRAW_STAT("Vertex Loaders", "%d", stats.numVertexLoaders); + DRAW_STAT("EFB peeks:", "%d", stats.thisFrame.numEFBPeeks); + DRAW_STAT("EFB pokes:", "%d", stats.thisFrame.numEFBPokes); #undef DRAW_STAT diff --git a/Source/Core/VideoCommon/Statistics.h b/Source/Core/VideoCommon/Statistics.h index c743bf7f08..431df7d9de 100644 --- a/Source/Core/VideoCommon/Statistics.h +++ b/Source/Core/VideoCommon/Statistics.h @@ -61,6 +61,9 @@ struct Statistics int numVerticesLoaded; int tevPixelsIn; int tevPixelsOut; + + int numEFBPeeks; + int numEFBPokes; }; ThisFrame thisFrame; void ResetFrame();