Reorder some stuff to make more sense.

This commit is contained in:
Henrik Rydgård committed 2023-08-10 16:12:50 +02:00
1 parent be708e3e02
commit dec320de2d
1 file changed
+15 -14
+15 -14
View File
@@ -1123,29 +1123,38 @@ void NativeFrame(GraphicsContext *graphicsContext) {
ortho = ortho * g_display.rot_matrix;
}
ui_draw2d.PushDrawMatrix(ortho);
ui_draw2d_front.PushDrawMatrix(ortho);
g_screenManager->getUIContext()->SetTintSaturation(g_Config.fUITint, g_Config.fUISaturation);
Draw::DebugFlags debugFlags = Draw::DebugFlags::NONE;
if ((DebugOverlay)g_Config.iDebugOverlay == DebugOverlay::GPU_PROFILE)
debugFlags |= Draw::DebugFlags::PROFILE_TIMESTAMPS;
if (g_Config.bGpuLogProfiler)
debugFlags |= Draw::DebugFlags::PROFILE_SCOPES;
g_screenManager->getDrawContext()->SetDebugFlags(debugFlags);
g_draw->BeginFrame();
ui_draw2d.PushDrawMatrix(ortho);
ui_draw2d_front.PushDrawMatrix(ortho);
g_screenManager->getUIContext()->SetTintSaturation(g_Config.fUITint, g_Config.fUISaturation);
// All actual rendering happen in here.
g_screenManager->render();
if (g_screenManager->getUIContext()->Text()) {
g_screenManager->getUIContext()->Text()->OncePerFrame();
}
ui_draw2d.PopDrawMatrix();
ui_draw2d_front.PopDrawMatrix();
g_draw->EndFrame();
// This, between EndFrame and Present, is where we should actually wait to do present time management.
// There might not be a meaningful distinction here for all backends..
if (renderCounter < 10 && ++renderCounter == 10) {
// We're rendering fine, clear out failure info.
ClearFailedGPUBackends();
}
g_draw->Present();
if (resized) {
@@ -1179,14 +1188,6 @@ void NativeFrame(GraphicsContext *graphicsContext) {
// INFO_LOG(G3D, "Polling graphics context");
graphicsContext->Poll();
}
ui_draw2d.PopDrawMatrix();
ui_draw2d_front.PopDrawMatrix();
if (renderCounter < 10 && ++renderCounter == 10) {
// We're rendering fine, clear out failure info.
ClearFailedGPUBackends();
}
}
void HandleGlobalMessage(const std::string &msg, const std::string &value) {