diff --git a/editor/src/Platform/Win32EditorHost.h b/editor/src/Platform/Win32EditorHost.h index 2046ee41..d07e7f0a 100644 --- a/editor/src/Platform/Win32EditorHost.h +++ b/editor/src/Platform/Win32EditorHost.h @@ -96,15 +96,24 @@ inline int RunEditor(HINSTANCE hInstance, int nCmdShow) { SendMessageW(hwnd, WM_SETICON, ICON_SMALL, reinterpret_cast(wc.hIconSm)); } - ShowWindow(hwnd, nCmdShow); - UpdateWindow(hwnd); - if (!Application::Get().Initialize(hwnd)) { DestroyWindow(hwnd); UnregisterClassW(wc.lpszClassName, wc.hInstance); return 1; } + // Warm up a few hidden frames first. On D3D12 flip-model swap chains the first visible + // presents can otherwise show only the host clear color while the UI/render backend settles. + constexpr int kBootstrapFrameCount = 3; + for (int frameIndex = 0; frameIndex < kBootstrapFrameCount; ++frameIndex) { + Application::Get().Render(); + } + + // Show the window only after the swap chain already contains composed editor frames. + ShowWindow(hwnd, nCmdShow); + Application::Get().Render(); + UpdateWindow(hwnd); + MSG msg = {}; while (msg.message != WM_QUIT) { if (PeekMessageW(&msg, nullptr, 0U, 0U, PM_REMOVE)) {