GE Debugger: Add separate step based on vsync.

I think there were some games where this would step in the middle of a
frame, but not seeing it commonly now.  So make it the default, but allow
both methods in the menu.

Fixes #15893.
This commit is contained in:
Unknown W. Brackets 2022-08-23 19:48:34 -07:00
parent c581a83896
commit a901fa4315
8 changed files with 21 additions and 9 deletions

View File

@ -106,8 +106,6 @@ void FramebufferManagerCommon::SetDisplayFramebuffer(u32 framebuf, u32 stride, G
displayFramebufPtr_ = framebuf;
displayStride_ = stride;
displayFormat_ = format;
// TODO: Some games like Spongebob - Yellow Avenger, never change framebuffer, they blit to it.
// So breaking on frames doesn't work. Might want to move this to sceDisplay vsync.
GPUDebug::NotifyDisplay(framebuf, stride, format);
GPURecord::NotifyDisplay(framebuf, stride, format);
}

View File

@ -154,6 +154,15 @@ void NotifyDisplay(u32 framebuf, u32 stride, int format) {
}
}
void NotifyBeginFrame() {
if (!active)
return;
if (breakNext == BreakNext::VSYNC) {
// Just start stepping as soon as we can once the vblank finishes.
breakNext = BreakNext::OP;
}
}
int PrimsThisFrame() {
return primsThisFrame;
}

View File

@ -28,6 +28,7 @@ enum class BreakNext {
TEX,
NONTEX,
FRAME,
VSYNC,
PRIM,
CURVE,
COUNT,
@ -43,6 +44,7 @@ void SetBreakCount(int c, bool relative = false);
bool NotifyCommand(u32 pc);
void NotifyDraw();
void NotifyDisplay(u32 framebuf, u32 stride, int format);
void NotifyBeginFrame();
int PrimsThisFrame();
int PrimsLastFrame();

View File

@ -1109,6 +1109,7 @@ void GPUCommon::BeginFrame() {
} else if (dumpThisFrame_) {
dumpThisFrame_ = false;
}
GPUDebug::NotifyBeginFrame();
GPURecord::NotifyBeginFrame();
}

View File

@ -430,10 +430,6 @@ void GPU_Vulkan::InitClear() {
}
}
void GPU_Vulkan::SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) {
framebufferManager_->SetDisplayFramebuffer(framebuf, stride, format);
}
void GPU_Vulkan::CopyDisplayToOutput(bool reallyDirty) {
// Flush anything left over.
drawEngine_.Flush();

View File

@ -979,6 +979,10 @@ BOOL CGEDebugger::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) {
SetBreakNext(BreakNext::FRAME);
break;
case IDC_GEDBG_STEPVSYNC:
SetBreakNext(BreakNext::VSYNC);
break;
case IDC_GEDBG_STEPPRIM:
SetBreakNext(BreakNext::PRIM);
break;

View File

@ -202,7 +202,7 @@ EXSTYLE WS_EX_ACCEPTFILES | WS_EX_TOOLWINDOW
CAPTION "GE"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
PUSHBUTTON "Step &Frame",IDC_GEDBG_STEPFRAME,10,2,44,14
PUSHBUTTON "Step &Frame",IDC_GEDBG_STEPVSYNC,10,2,44,14
PUSHBUTTON "Step &Tex",IDC_GEDBG_STEPTEX,60,2,44,14
PUSHBUTTON "Step &Draw",IDC_GEDBG_STEPDRAW,105,2,44,14
PUSHBUTTON "Step &Prim",IDC_GEDBG_STEPPRIM,150,2,44,14
@ -679,7 +679,8 @@ BEGIN
MENUITEM "Next &Curve", IDC_GEDBG_STEPCURVE
MENUITEM "Next &Texture", IDC_GEDBG_STEPTEX
MENUITEM "Next &Draw Flush", IDC_GEDBG_STEPDRAW
MENUITEM "Next &Frame", IDC_GEDBG_STEPFRAME
MENUITEM "Next Display &Framebuf", IDC_GEDBG_STEPFRAME
MENUITEM "Next &Vsync Frame", IDC_GEDBG_STEPVSYNC
MENUITEM "", 0, MFT_SEPARATOR
MENUITEM "&Auto Flush Pending", IDC_GEDBG_FLUSHAUTO
END

View File

@ -331,6 +331,7 @@
#define ID_GEDBG_SHOWONLEFT 40219
#define ID_GEDBG_SHOWONRIGHT 40220
#define ID_GEDBG_SHOWONTOPRIGHT 40221
#define IDC_GEDBG_STEPVSYNC 40222
// Dummy option to let the buffered rendering hotkey cycle through all the options.
@ -344,7 +345,7 @@
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 256
#define _APS_NEXT_COMMAND_VALUE 40222
#define _APS_NEXT_COMMAND_VALUE 40223
#define _APS_NEXT_CONTROL_VALUE 1202
#define _APS_NEXT_SYMED_VALUE 101
#endif