Skip to content

Commit

Permalink
Display: Account for stepping time in graphs.
Browse files Browse the repository at this point in the history
Frame times should count that as sleep too.
  • Loading branch information
unknownbrackets committed Jan 30, 2022
1 parent 48b597a commit 129a603
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Core/Core.cpp
Expand Up @@ -39,6 +39,7 @@
#include "Core/SaveState.h"
#include "Core/System.h"
#include "Core/Debugger/Breakpoints.h"
#include "Core/HW/Display.h"
#include "Core/MIPS/MIPS.h"
#include "GPU/Debugger/Stepping.h"

Expand Down Expand Up @@ -279,8 +280,11 @@ void Core_SingleStep() {
static inline bool Core_WaitStepping() {
std::unique_lock<std::mutex> guard(m_hStepMutex);
// We only wait 16ms so that we can still draw UI or react to events.
double sleepStart = time_now_d();
if (!singleStepPending && coreState == CORE_STEPPING)
m_StepCond.wait_for(guard, std::chrono::milliseconds(16));
double sleepEnd = time_now_d();
DisplayNotifySleep(sleepEnd - sleepStart);

bool result = singleStepPending;
singleStepPending = false;
Expand Down
2 changes: 2 additions & 0 deletions GPU/GPUCommon.cpp
Expand Up @@ -27,6 +27,7 @@
#include "Core/HLE/sceKernelInterrupt.h"
#include "Core/HLE/sceKernelThread.h"
#include "Core/HLE/sceGe.h"
#include "Core/HW/Display.h"
#include "Core/MemMapHelpers.h"
#include "Core/Util/PPGeDraw.h"
#include "GPU/Common/DrawEngineCommon.h"
Expand Down Expand Up @@ -1032,6 +1033,7 @@ bool GPUCommon::InterpretList(DisplayList &list) {
double total = time_now_d() - start - timeSpentStepping_;
_dbg_assert_msg_(total >= 0.0, "Time spent DL processing became negative");
hleSetSteppingTime(timeSpentStepping_);
DisplayNotifySleep(timeSpentStepping_);
timeSpentStepping_ = 0.0;
gpuStats.msProcessingDisplayLists += total;
}
Expand Down

0 comments on commit 129a603

Please sign in to comment.