Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GE Debugger: Record only one flip if display framebuf not changed, step on vsync #15894

Merged
merged 4 commits into from
Aug 24, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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.
  • Loading branch information
unknownbrackets committed Aug 24, 2022
commit a901fa431520588f4207ce232e6087296bb7df6d
2 changes: 0 additions & 2 deletions GPU/Common/FramebufferManagerCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
9 changes: 9 additions & 0 deletions GPU/Debugger/Debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 2 additions & 0 deletions GPU/Debugger/Debugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ enum class BreakNext {
TEX,
NONTEX,
FRAME,
VSYNC,
PRIM,
CURVE,
COUNT,
Expand All @@ -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();
Expand Down
1 change: 1 addition & 0 deletions GPU/GPUCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,7 @@ void GPUCommon::BeginFrame() {
} else if (dumpThisFrame_) {
dumpThisFrame_ = false;
}
GPUDebug::NotifyBeginFrame();
GPURecord::NotifyBeginFrame();
}

Expand Down
4 changes: 0 additions & 4 deletions GPU/Vulkan/GPU_Vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 4 additions & 0 deletions Windows/GEDebugger/GEDebugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions Windows/ppsspp.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion Windows/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down