Run the imgui processing early in the frame, only do the rendering late

This commit is contained in:
Henrik Rydgård
2024-12-15 00:17:26 +01:00
parent 2fe5642156
commit 15b63aa812
3 changed files with 18 additions and 1 deletions
+14 -1
View File
@@ -1539,6 +1539,11 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) {
}
}
// Running it early allows things like direct readbacks of buffers, things we can't do
// when we have started the final render pass. Well, technically we probably could with some manipulation
// of pass order in the render managers..
runImDebugger();
bool blockedExecution = Achievements::IsBlockingExecution();
uint32_t clearColor = 0;
if (!blockedExecution) {
@@ -1655,7 +1660,7 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) {
return flags;
}
void EmuScreen::renderImDebugger() {
void EmuScreen::runImDebugger() {
if (g_Config.bShowImDebugger) {
Draw::DrawContext *draw = screenManager()->getDrawContext();
if (!imguiInited_) {
@@ -1691,6 +1696,14 @@ void EmuScreen::renderImDebugger() {
imDebugger_->Frame(currentDebugMIPS, gpuDebug);
ImGui::Render();
}
}
}
void EmuScreen::renderImDebugger() {
if (g_Config.bShowImDebugger) {
Draw::DrawContext *draw = screenManager()->getDrawContext();
if (PSP_IsInited()) {
ImGui_ImplThin3d_RenderDrawData(ImGui::GetDrawData(), draw);
}
}
+1
View File
@@ -79,6 +79,7 @@ private:
void bootComplete();
bool hasVisibleUI();
void renderUI();
void runImDebugger();
void renderImDebugger();
void onVKey(int virtualKeyCode, bool down);
+3
View File
@@ -65,6 +65,9 @@ void ShowInWindowMenuItems(uint32_t addr, ImControl &control) {
}
void StatusBar(std::string_view status) {
if (!status.size()) {
return;
}
ImGui::TextUnformatted(status.data(), status.data() + status.length());
ImGui::SameLine();
if (ImGui::SmallButton("Copy")) {