Add a new GPU stat (DrawPixels), kinda heavy since creates textures. GoW does 20-ish per frame.

This commit is contained in:
Henrik Rydgård 2023-05-30 00:51:10 +02:00
parent f54f905be5
commit ea552bc573
3 changed files with 8 additions and 3 deletions

View file

@ -1418,10 +1418,12 @@ Draw::Texture *FramebufferManagerCommon::MakePixelTexture(const u8 *srcPixels, G
};
// Hot Shots Golf (#12355) does tons of these in a frame in some situations! So creating textures
// better be fast.
// better be fast. So does God of War, a lot of the time, a bit unclear what it's doing.
Draw::Texture *tex = draw_->CreateTexture(desc);
if (!tex)
if (!tex) {
ERROR_LOG(G3D, "Failed to create DrawPixels texture");
}
gpuStats.numDrawPixels++;
return tex;
}

View file

@ -100,6 +100,7 @@ struct GPUStatistics {
numColorCopies = 0;
numCopiesForShaderBlend = 0;
numCopiesForSelfTex = 0;
numDrawPixels = 0;
numReplacerTrackedTex = 0;
numCachedReplacedTextures = 0;
msProcessingDisplayLists = 0;
@ -135,6 +136,7 @@ struct GPUStatistics {
int numColorCopies;
int numCopiesForShaderBlend;
int numCopiesForSelfTex;
int numDrawPixels;
int numReplacerTrackedTex;
int numCachedReplacedTextures;
double msProcessingDisplayLists;

View file

@ -1652,7 +1652,7 @@ size_t GPUCommonHW::FormatGPUStatsCommon(char *buffer, size_t size) {
"Textures: %d, dec: %d, invalidated: %d, hashed: %d kB\n"
"readbacks %d (%d non-block), uploads %d, depal %d\n"
"replacer: tracks %d references, %d unique textures\n"
"Copies: depth %d, color %d, reint %d, blend %d, selftex %d\n"
"Cpy: depth %d, color %d, reint %d, blend %d, self %d, drawpix %d\n"
"GPU cycles executed: %d (%f per vertex)\n",
gpuStats.msProcessingDisplayLists * 1000.0f,
gpuStats.numDrawSyncs,
@ -1682,6 +1682,7 @@ size_t GPUCommonHW::FormatGPUStatsCommon(char *buffer, size_t size) {
gpuStats.numReinterpretCopies,
gpuStats.numCopiesForShaderBlend,
gpuStats.numCopiesForSelfTex,
gpuStats.numDrawPixels,
gpuStats.vertexGPUCycles + gpuStats.otherGPUCycles,
vertexAverageCycles
);