Skip to content

Commit

Permalink
Add a block transfer GPU stat, remove a redundant one
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Oct 3, 2023
1 parent 7a2f308 commit 226d257
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
4 changes: 1 addition & 3 deletions GPU/Common/FramebufferManagerCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1403,7 +1403,6 @@ Draw::Texture *FramebufferManagerCommon::MakePixelTexture(const u8 *srcPixels, G
}

// OK, current one seems good, let's use it (and mark it used).
gpuStats.numDrawPixels++;
draw_->UpdateTextureLevels(iter.tex, &srcPixels, generateTexture, 1);
// NOTE: numFlips is no good - this is called every frame when paused sometimes!
iter.frameNumber = frameNumber;
Expand Down Expand Up @@ -1432,8 +1431,7 @@ Draw::Texture *FramebufferManagerCommon::MakePixelTexture(const u8 *srcPixels, G
if (!tex) {
ERROR_LOG(G3D, "Failed to create DrawPixels texture");
}
gpuStats.numDrawPixels++;
gpuStats.numTexturesDecoded++; // Separate stat for this later?
// We don't need to count here, already counted by numUploads by the caller.

// INFO_LOG(G3D, "Creating drawPixelsCache texture: %dx%d", tex->Width(), tex->Height());

Expand Down
4 changes: 2 additions & 2 deletions GPU/GPU.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ struct GPUStatistics {
numColorCopies = 0;
numCopiesForShaderBlend = 0;
numCopiesForSelfTex = 0;
numDrawPixels = 0;
numBlockTransfers = 0;
numReplacerTrackedTex = 0;
numCachedReplacedTextures = 0;
msProcessingDisplayLists = 0;
Expand Down Expand Up @@ -139,7 +139,7 @@ struct GPUStatistics {
int numColorCopies;
int numCopiesForShaderBlend;
int numCopiesForSelfTex;
int numDrawPixels;
int numBlockTransfers;
int numReplacerTrackedTex;
int numCachedReplacedTextures;
double msProcessingDisplayLists;
Expand Down
1 change: 1 addition & 0 deletions GPU/GPUCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1665,6 +1665,7 @@ void GPUCommon::DoBlockTransfer(u32 skipDrawReason) {
int bpp = gstate.getTransferBpp();

DEBUG_LOG(G3D, "Block transfer: %08x/%x -> %08x/%x, %ix%ix%i (%i,%i)->(%i,%i)", srcBasePtr, srcStride, dstBasePtr, dstStride, width, height, bpp, srcX, srcY, dstX, dstY);
gpuStats.numBlockTransfers++;

// For VRAM, we wrap around when outside valid memory (mirrors still work.)
if ((srcBasePtr & 0x04800000) == 0x04800000)
Expand Down
10 changes: 6 additions & 4 deletions GPU/GPUCommonHW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1683,9 +1683,10 @@ size_t GPUCommonHW::FormatGPUStatsCommon(char *buffer, size_t size) {
"FBOs active: %d (evaluations: %d)\n"
"Textures: %d, dec: %d, invalidated: %d, hashed: %d kB\n"
"readbacks %d (%d non-block), uploads %d, depal %d\n"
"block transfers: %d\n"
"replacer: tracks %d references, %d unique textures\n"
"Cpy: depth %d, color %d, reint %d, blend %d, self %d, drawpix %d\n"
"GPU cycles executed: %d (%f per vertex)\n",
"Cpy: depth %d, color %d, reint %d, blend %d, self %d\n"
"GPU cycles: %d (%f per vertex)\n%s",
gpuStats.msProcessingDisplayLists * 1000.0f,
gpuStats.numDrawSyncs,
gpuStats.numListSyncs,
Expand All @@ -1710,15 +1711,16 @@ size_t GPUCommonHW::FormatGPUStatsCommon(char *buffer, size_t size) {
gpuStats.numReadbacks,
gpuStats.numUploads,
gpuStats.numDepal,
gpuStats.numBlockTransfers,
gpuStats.numReplacerTrackedTex,
gpuStats.numCachedReplacedTextures,
gpuStats.numDepthCopies,
gpuStats.numColorCopies,
gpuStats.numReinterpretCopies,
gpuStats.numCopiesForShaderBlend,
gpuStats.numCopiesForSelfTex,
gpuStats.numDrawPixels,
gpuStats.vertexGPUCycles + gpuStats.otherGPUCycles,
vertexAverageCycles
vertexAverageCycles,
debugRecording_ ? "(debug-recording)" : ""
);
}

0 comments on commit 226d257

Please sign in to comment.