Skip to content
Permalink
Browse files
Merge pull request #11099 from Pokechu22/draw_done_and_token_stats
VideoCommon: Add statistics for draw done and token commands
  • Loading branch information
AdmiralCurtiss committed Sep 28, 2022
2 parents dd3db94 + 3956939 commit 4de70f1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
@@ -33,6 +33,7 @@
#include "VideoCommon/PixelEngine.h"
#include "VideoCommon/PixelShaderManager.h"
#include "VideoCommon/RenderBase.h"
#include "VideoCommon/Statistics.h"
#include "VideoCommon/TMEM.h"
#include "VideoCommon/TextureCacheBase.h"
#include "VideoCommon/TextureDecoder.h"
@@ -177,6 +178,7 @@ static void BPWritten(const BPCmd& bp, int cycles_into_future)
switch (bp.newvalue & 0xFF)
{
case 0x02:
INCSTAT(g_stats.this_frame.num_draw_done);
g_texture_cache->FlushEFBCopies();
g_framebuffer_manager->InvalidatePeekCache(false);
if (!Fifo::UseDeterministicGPUThread())
@@ -190,13 +192,15 @@ static void BPWritten(const BPCmd& bp, int cycles_into_future)
}
return;
case BPMEM_PE_TOKEN_ID: // Pixel Engine Token ID
INCSTAT(g_stats.this_frame.num_token);
g_texture_cache->FlushEFBCopies();
g_framebuffer_manager->InvalidatePeekCache(false);
if (!Fifo::UseDeterministicGPUThread())
PixelEngine::SetToken(static_cast<u16>(bp.newvalue & 0xFFFF), false, cycles_into_future);
DEBUG_LOG_FMT(VIDEO, "SetPEToken {:#06X}", bp.newvalue & 0xFFFF);
return;
case BPMEM_PE_TOKEN_INT_ID: // Pixel Engine Interrupt Token ID
INCSTAT(g_stats.this_frame.num_token_int);
g_texture_cache->FlushEFBCopies();
g_framebuffer_manager->InvalidatePeekCache(false);
if (!Fifo::UseDeterministicGPUThread())
@@ -93,6 +93,8 @@ void Statistics::Display() const
draw_statistic("Vertex Loaders", "%d", num_vertex_loaders);
draw_statistic("EFB peeks:", "%d", this_frame.num_efb_peeks);
draw_statistic("EFB pokes:", "%d", this_frame.num_efb_pokes);
draw_statistic("Draw dones:", "%d", this_frame.num_draw_done);
draw_statistic("Tokens:", "%d/%d", this_frame.num_token, this_frame.num_token_int);

ImGui::Columns(1);

@@ -71,6 +71,10 @@ struct Statistics

int num_efb_peeks;
int num_efb_pokes;

int num_draw_done;
int num_token;
int num_token_int;
};
ThisFrame this_frame;
void ResetFrame();

0 comments on commit 4de70f1

Please sign in to comment.