Debugger: Prevent record with no commands.

Should cut down on empty dumps, at least.
This commit is contained in:
Unknown W. Brackets 2018-09-01 09:45:35 -07:00
parent f1afc51994
commit c10b2035b5
3 changed files with 9 additions and 3 deletions

View File

@ -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;
@ -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;
}

View File

@ -637,6 +637,10 @@ bool IsActive() {
return active;
}
bool IsActivePending() {
return nextFrame || active;
}
void Activate() {
nextFrame = true;
}
@ -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;

View File

@ -23,6 +23,7 @@
namespace GPURecord {
bool IsActive();
bool IsActivePending();
void Activate();
void NotifyCommand(u32 pc);