Skip to content

Commit

Permalink
Debugger: Prevent record with no commands.
Browse files Browse the repository at this point in the history
Should cut down on empty dumps, at least.
  • Loading branch information
unknownbrackets committed Sep 1, 2018
1 parent f1afc51 commit c10b203
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Core/HLE/sceDisplay.cpp
Expand Up @@ -55,6 +55,7 @@
#include "GPU/GPUInterface.h"
#include "GPU/Common/FramebufferCommon.h"
#include "GPU/Common/PostShader.h"
#include "GPU/Debugger/Record.h"

struct FrameBufferState {
u32 topaddr;
Expand Down Expand Up @@ -737,7 +738,7 @@ void __DisplayFlip(int cyclesLate) {
// 4 here means 1 drawn, 4 skipped - so 12 fps minimum.
maxFrameskip = g_Config.iFrameSkip;
}
if (numSkippedFrames >= maxFrameskip) {
if (numSkippedFrames >= maxFrameskip || GPURecord::IsActivePending()) {
skipFrame = false;
}

Expand Down
8 changes: 6 additions & 2 deletions GPU/Debugger/Record.cpp
Expand Up @@ -637,6 +637,10 @@ bool IsActive() {
return active;
}

bool IsActivePending() {
return nextFrame || active;
}

void Activate() {
nextFrame = true;
}
Expand Down Expand Up @@ -749,12 +753,12 @@ void NotifyUpload(u32 dest, u32 sz) {
}

void NotifyFrame() {
if (active && !writePending) {
if (active && !writePending && !commands.empty()) {
// Delay write until the first command of the next frame, so we get the right display buf.
NOTICE_LOG(SYSTEM, "Recording complete - waiting to get display buffer");
writePending = true;
}
if (nextFrame) {
if (nextFrame && (gstate_c.skipDrawReason & SKIPDRAW_SKIPFRAME) == 0) {
NOTICE_LOG(SYSTEM, "Recording starting...");
active = true;
nextFrame = false;
Expand Down
1 change: 1 addition & 0 deletions GPU/Debugger/Record.h
Expand Up @@ -23,6 +23,7 @@
namespace GPURecord {

bool IsActive();
bool IsActivePending();
void Activate();

void NotifyCommand(u32 pc);
Expand Down

0 comments on commit c10b203

Please sign in to comment.