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

Update Gfx Debugger for more OTR commands, UCODE support, and add context menu #668

Merged
merged 2 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
15 changes: 15 additions & 0 deletions src/graphic/Fast3D/gfx_pc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4091,12 +4091,20 @@ void gfx_run(Gfx* commands, const std::unordered_map<Mtx*, MtxF>& mtx_replacemen
if (dbg->IsDebugging()) {
g_exec_stack.gfx_path.push_back(cmd);
if (dbg->HasBreakPoint(g_exec_stack.gfx_path)) {
// On a breakpoint with the active framebuffer still set, we need to reset back to prevent
// soft locking the renderer
if (fbActive) {
fbActive = 0;
gfx_rapi->start_draw_to_framebuffer(game_renders_to_framebuffer ? game_framebuffer : 0, 1);
}

break;
}
g_exec_stack.gfx_path.pop_back();
}
gfx_step();
}

gfx_flush();
gfxFramebuffer = 0;
currentDir = std::stack<std::string>();
Expand All @@ -4118,7 +4126,14 @@ void gfx_run(Gfx* commands, const std::unordered_map<Mtx*, MtxF>& mtx_replacemen
} else {
gfxFramebuffer = (uintptr_t)gfx_rapi->get_framebuffer_texture_id(game_framebuffer);
}
} else if (fbActive) {
// Failsafe reset to main framebuffer to prevent softlocking the renderer
fbActive = 0;
gfx_rapi->start_draw_to_framebuffer(0, 1);

assert(0 && "active framebuffer was never reset back to original");
}

Ship::Context::GetInstance()->GetWindow()->GetGui()->StartFrame();
Ship::Context::GetInstance()->GetWindow()->GetGui()->RenderViewports();
gfx_rapi->end_frame();
Expand Down
Loading
Loading