diff --git a/Common/UI/Tween.h b/Common/UI/Tween.h index ee20fef026..f290c0e497 100644 --- a/Common/UI/Tween.h +++ b/Common/UI/Tween.h @@ -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; } diff --git a/GPU/Common/TextureShaderCommon.cpp b/GPU/Common/TextureShaderCommon.cpp index a4a979126d..f17b29ea22 100644 --- a/GPU/Common/TextureShaderCommon.cpp +++ b/GPU/Common/TextureShaderCommon.cpp @@ -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) { diff --git a/GPU/Common/TextureShaderCommon.h b/GPU/Common/TextureShaderCommon.h index 37d2c32a52..991d1ac35f 100644 --- a/GPU/Common/TextureShaderCommon.h +++ b/GPU/Common/TextureShaderCommon.h @@ -27,7 +27,6 @@ #include "GPU/Common/Draw2D.h" #include "GPU/Common/ShaderCommon.h" - class ClutTexture { public: enum { MAX_RAMPS = 3 }; diff --git a/GPU/GPU.h b/GPU/GPU.h index ae60d2ba30..d0de862466 100644 --- a/GPU/GPU.h +++ b/GPU/GPU.h @@ -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; diff --git a/GPU/GPUCommonHW.cpp b/GPU/GPUCommonHW.cpp index 9dcbc9cc3a..678ec52428 100644 --- a/GPU/GPUCommonHW.cpp +++ b/GPU/GPUCommonHW.cpp @@ -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,