new_editor: stabilize resize lifecycle groundwork

This commit is contained in:
2026-04-23 00:36:28 +08:00
parent c10367a42e
commit 03e0b362f7
19 changed files with 439 additions and 161 deletions

View File

@@ -120,14 +120,6 @@ D3D12WindowRenderLoopPresentResult D3D12WindowRenderLoop::Present(
return result;
}
if (!m_windowRenderer->SignalFrameCompletion()) {
const std::string& error = m_windowRenderer->GetLastError();
result.warning = error.empty()
? "failed to signal current frame completion."
: error;
return result;
}
if (captureOutputPath != nullptr) {
std::string captureError = {};
if (!m_windowRenderer->CaptureCurrentBackBufferToPng(*captureOutputPath, captureError)) {
@@ -139,14 +131,24 @@ D3D12WindowRenderLoopPresentResult D3D12WindowRenderLoop::Present(
}
}
if (!m_windowRenderer->PresentFrame()) {
const bool presented = m_windowRenderer->PresentFrame();
const std::string presentError = m_windowRenderer->GetLastError();
if (!m_windowRenderer->SignalFrameCompletion()) {
const std::string& error = m_windowRenderer->GetLastError();
result.warning = error.empty()
? "failed to present the swap chain."
? "failed to signal current frame completion."
: error;
return result;
}
if (!presented) {
result.warning = presentError.empty()
? "failed to present the swap chain."
: presentError;
return result;
}
result.framePresented = true;
return result;
}