Cleanup, add another GPU stat

This commit is contained in:
Henrik Rydgård 2024-10-29 08:16:57 +01:00
parent 10db7de53c
commit ab1072224f
5 changed files with 12 additions and 8 deletions

View File

@ -77,8 +77,9 @@ public:
void Divert(const Value &newTo, float newDuration = -1.0f) {
const Value newFrom = valid_ ? Current(Position()) : newTo;
double now = time_now_d();
// Are we already part way through another transition?
if (time_now_d() < start_ + delay_ + duration_ && valid_) {
if (now < start_ + delay_ + duration_ && valid_) {
if (newTo == to_) {
// Already on course. Don't change.
return;
@ -88,17 +89,17 @@ public:
if (newDuration >= 0.0f) {
newOffset *= newDuration / duration_;
}
start_ = time_now_d() - newOffset - delay_;
} else if (time_now_d() <= start_ + delay_) {
start_ = now - newOffset - delay_;
} else if (now <= start_ + delay_) {
// Start the delay over again.
start_ = time_now_d();
start_ = now;
} else {
// Since we've partially animated to the other value, skip delay.
start_ = time_now_d() - delay_;
start_ = now - delay_;
}
} else {
// Already finished, so restart.
start_ = time_now_d();
start_ = now;
finishApplied_ = false;
}

View File

@ -194,6 +194,7 @@ void TextureShaderCache::Decimate() {
++tex;
}
}
gpuStats.numClutTextures = (int)texCache_.size();
}
Draw2DPipeline *TextureShaderCache::GetDepalettizeShader(uint32_t clutMode, GETextureFormat textureFormat, GEBufferFormat bufferFormat, bool smoothedDepal, u32 depthUpperBits) {

View File

@ -27,7 +27,6 @@
#include "GPU/Common/Draw2D.h"
#include "GPU/Common/ShaderCommon.h"
class ClutTexture {
public:
enum { MAX_RAMPS = 3 };

View File

@ -105,6 +105,7 @@ struct GPUStatistics {
numBlockTransfers = 0;
numReplacerTrackedTex = 0;
numCachedReplacedTextures = 0;
numClutTextures = 0;
msProcessingDisplayLists = 0;
vertexGPUCycles = 0;
otherGPUCycles = 0;
@ -142,6 +143,7 @@ struct GPUStatistics {
int numBlockTransfers;
int numReplacerTrackedTex;
int numCachedReplacedTextures;
int numClutTextures;
double msProcessingDisplayLists;
int vertexGPUCycles;
int otherGPUCycles;

View File

@ -1756,7 +1756,7 @@ size_t GPUCommonHW::FormatGPUStatsCommon(char *buffer, size_t size) {
"Draw: %d (%d dec, %d culled), flushes %d, clears %d, bbox jumps %d (%d updates)\n"
"Vertices: %d dec: %d drawn: %d\n"
"FBOs active: %d (evaluations: %d)\n"
"Textures: %d, dec: %d, invalidated: %d, hashed: %d kB\n"
"Textures: %d, dec: %d, invalidated: %d, hashed: %d kB, clut %d\n"
"readbacks %d (%d non-block), upload %d (cached %d), depal %d\n"
"block transfers: %d\n"
"replacer: tracks %d references, %d unique textures\n"
@ -1781,6 +1781,7 @@ size_t GPUCommonHW::FormatGPUStatsCommon(char *buffer, size_t size) {
gpuStats.numTexturesDecoded,
gpuStats.numTextureInvalidations,
gpuStats.numTextureDataBytesHashed / 1024,
gpuStats.numClutTextures,
gpuStats.numBlockingReadbacks,
gpuStats.numReadbacks,
gpuStats.numUploads,