diff --git a/Core/Dialog/PSPOskDialog.cpp b/Core/Dialog/PSPOskDialog.cpp index 6ac4ed7350..c867e47ec1 100755 --- a/Core/Dialog/PSPOskDialog.cpp +++ b/Core/Dialog/PSPOskDialog.cpp @@ -22,6 +22,7 @@ #include "Core/Dialog/PSPOskDialog.h" #include "Core/Util/PPGeDraw.h" #include "Core/HLE/sceCtrl.h" +#include "Core/HLE/sceDisplay.h" #include "Core/HLE/sceUtility.h" #include "Core/Config.h" #include "Core/Reporting.h" @@ -746,7 +747,7 @@ void PSPOskDialog::RenderKeyboard() if(isCombinated == true) { - float animStep = (float)(gpuStats.numVBlanks % 40) / 20.0f; + float animStep = (float)(__DisplayGetNumVblanks() % 40) / 20.0f; // Fade in and out the next character so they know it's not part of the string yet. u32 alpha = (0.5f - (cosf(animStep * M_PI) / 2.0f)) * 128 + 127; color = CalcFadedColor((alpha << 24) | 0xFFFFFF); diff --git a/Core/HLE/sceDisplay.cpp b/Core/HLE/sceDisplay.cpp index c1a876d4eb..cd861be764 100644 --- a/Core/HLE/sceDisplay.cpp +++ b/Core/HLE/sceDisplay.cpp @@ -111,6 +111,7 @@ static const double timePerVblank = 1.001f / 60.0f; static double curFrameTime; static double lastFrameTime; static double nextFrameTime; +static int numVBlanks; static int numVBlanksSinceFlip; static u64 frameStartTicks; @@ -161,6 +162,7 @@ void __DisplayVblankBeginCallback(SceUID threadID, SceUID prevCallbackId); void __DisplayVblankEndCallback(SceUID threadID, SceUID prevCallbackId); int __DisplayGetFlipCount() { return actualFlips; } int __DisplayGetVCount() { return vCount; } +int __DisplayGetNumVblanks() { return numVBlanks; } static void ScheduleLagSync(int over = 0) { lagSyncScheduled = g_Config.bForceLagSync; @@ -179,6 +181,7 @@ void __DisplayInit() { width = 480; height = 272; numSkippedFrames = 0; + numVBlanks = 0; numVBlanksSinceFlip = 0; framebufIsLatched = false; framebuf.topaddr = 0x04000000; @@ -399,13 +402,13 @@ static void CalculateFPS() { double now = time_now_d(); if (now >= lastFpsTime + 1.0) { - double frames = (gpuStats.numVBlanks - lastFpsFrame); + double frames = (numVBlanks - lastFpsFrame); actualFps = (actualFlips - lastActualFlips); fps = frames / (now - lastFpsTime); flips = 60.0 * (double) (gpuStats.numFlips - lastNumFlips) / frames; - lastFpsFrame = gpuStats.numVBlanks; + lastFpsFrame = numVBlanks; lastNumFlips = gpuStats.numFlips; lastActualFlips = actualFlips; lastFpsTime = now; @@ -606,8 +609,7 @@ void hleEnterVblank(u64 userdata, int cyclesLate) { // Trigger VBlank interrupt handlers. __TriggerInterrupt(PSP_INTR_IMMEDIATE | PSP_INTR_ONLY_IF_ENABLED | PSP_INTR_ALWAYS_RESCHED, PSP_VBLANK_INTR, PSP_INTR_SUB_ALL); - gpuStats.numVBlanks++; - + numVBlanks++; numVBlanksSinceFlip++; // TODO: Should this be done here or in hleLeaveVblank? diff --git a/Core/HLE/sceDisplay.h b/Core/HLE/sceDisplay.h index 327d965c88..caaeafa72d 100644 --- a/Core/HLE/sceDisplay.h +++ b/Core/HLE/sceDisplay.h @@ -37,6 +37,7 @@ void __DisplayGetDebugStats(char stats[], size_t bufsize); void __DisplayGetFPS(float *out_vps, float *out_fps, float *out_actual_fps); void __DisplayGetVPS(float *out_vps); void __DisplayGetAveragedFPS(float *out_vps, float *out_fps); +int __DisplayGetNumVblanks(); int __DisplayGetVCount(); int __DisplayGetFlipCount(); diff --git a/GPU/Directx9/GPU_DX9.cpp b/GPU/Directx9/GPU_DX9.cpp index 1ebc1e8f6d..5771eacf35 100644 --- a/GPU/Directx9/GPU_DX9.cpp +++ b/GPU/Directx9/GPU_DX9.cpp @@ -1867,7 +1867,6 @@ void DIRECTX9_GPU::FastLoadBoneMatrix(u32 target) { void DIRECTX9_GPU::GetStats(char *buffer, size_t bufsize) { float vertexAverageCycles = gpuStats.numVertsSubmitted > 0 ? (float)gpuStats.vertexGPUCycles / (float)gpuStats.numVertsSubmitted : 0.0f; snprintf(buffer, bufsize - 1, - "Frames: %i\n" "DL processing time: %0.2f ms\n" "Draw calls: %i, flushes %i\n" "Cached Draw calls: %i\n" @@ -1879,7 +1878,6 @@ void DIRECTX9_GPU::GetStats(char *buffer, size_t bufsize) { "FBOs active: %i\n" "Textures active: %i, decoded: %i invalidated: %i\n" "Vertex, Fragment shaders loaded: %i, %i\n", - gpuStats.numVBlanks, gpuStats.msProcessingDisplayLists * 1000.0f, gpuStats.numDrawCalls, gpuStats.numFlushes, diff --git a/GPU/GLES/GLES_GPU.cpp b/GPU/GLES/GLES_GPU.cpp index ae8080d49e..eab3566c59 100644 --- a/GPU/GLES/GLES_GPU.cpp +++ b/GPU/GLES/GLES_GPU.cpp @@ -2119,7 +2119,6 @@ void GLES_GPU::FastLoadBoneMatrix(u32 target) { void GLES_GPU::GetStats(char *buffer, size_t bufsize) { float vertexAverageCycles = gpuStats.numVertsSubmitted > 0 ? (float)gpuStats.vertexGPUCycles / (float)gpuStats.numVertsSubmitted : 0.0f; snprintf(buffer, bufsize - 1, - "Frames: %i\n" "DL processing time: %0.2f ms\n" "Draw calls: %i, flushes %i\n" "Cached Draw calls: %i\n" @@ -2131,7 +2130,6 @@ void GLES_GPU::GetStats(char *buffer, size_t bufsize) { "FBOs active: %i\n" "Textures active: %i, decoded: %i invalidated: %i\n" "Vertex, Fragment, Programs loaded: %i, %i, %i\n", - gpuStats.numVBlanks, gpuStats.msProcessingDisplayLists * 1000.0f, gpuStats.numDrawCalls, gpuStats.numFlushes, diff --git a/GPU/GPU.h b/GPU/GPU.h index a7c870ae0e..f48fc940ea 100644 --- a/GPU/GPU.h +++ b/GPU/GPU.h @@ -90,8 +90,7 @@ struct GPUStatistics { int otherGPUCycles; int gpuCommandsAtCallLevel[4]; - // Total statistics, updated by the GPU core in UpdateStats - int numVBlanks; + // Flip count. Doesn't really belong here. int numFlips; }; diff --git a/GPU/Vulkan/GPU_Vulkan.cpp b/GPU/Vulkan/GPU_Vulkan.cpp index 246bfd6229..02aac400da 100644 --- a/GPU/Vulkan/GPU_Vulkan.cpp +++ b/GPU/Vulkan/GPU_Vulkan.cpp @@ -1957,7 +1957,6 @@ void GPU_Vulkan::GetStats(char *buffer, size_t bufsize) { const DrawEngineVulkanStats &drawStats = drawEngine_.GetStats(); float vertexAverageCycles = gpuStats.numVertsSubmitted > 0 ? (float)gpuStats.vertexGPUCycles / (float)gpuStats.numVertsSubmitted : 0.0f; snprintf(buffer, bufsize - 1, - "Frames: %i\n" "DL processing time: %0.2f ms\n" "Draw calls: %i, flushes %i\n" "Cached Draw calls: %i\n" @@ -1970,7 +1969,6 @@ void GPU_Vulkan::GetStats(char *buffer, size_t bufsize) { "Textures active: %i, decoded: %i invalidated: %i\n" "Vertex, Fragment, Pipelines loaded: %i, %i, %i\n" "Pushbuffer space used: UBO %d, Vtx %d, Idx %d\n", - gpuStats.numVBlanks, gpuStats.msProcessingDisplayLists * 1000.0f, gpuStats.numDrawCalls, gpuStats.numFlushes,