Decouple editor windowing from D3D12 runtime
This commit is contained in:
@@ -242,8 +242,18 @@ bool EditorWindow::InitializeRuntime(
|
||||
LogRuntimeTrace("window", dpiTrace.str());
|
||||
|
||||
MarkInitializing();
|
||||
UINT clientWidth = 0u;
|
||||
UINT clientHeight = 0u;
|
||||
if (!QueryCurrentClientPixelSize(clientWidth, clientHeight)) {
|
||||
clientWidth = 1u;
|
||||
clientHeight = 1u;
|
||||
}
|
||||
const bool initialized = m_runtime->Initialize(
|
||||
m_session->GetHwnd(),
|
||||
Rendering::Host::EditorWindowRenderRuntimeSurface{
|
||||
.nativeWindowHandle = m_session->GetHwnd(),
|
||||
.widthPixels = clientWidth,
|
||||
.heightPixels = clientHeight,
|
||||
},
|
||||
params.repoRoot,
|
||||
params.captureRoot,
|
||||
params.autoCaptureOnStartup);
|
||||
@@ -641,7 +651,7 @@ EditorWindowFrameTransferRequests EditorWindow::RenderHostFrame(
|
||||
UIDrawList& windowChromeDrawList = drawData.EmplaceDrawList("XCEditorWindow.Chrome");
|
||||
m_chromeController->AppendChrome(*this, windowChromeDrawList, width);
|
||||
|
||||
const Host::D3D12WindowRenderLoopPresentResult presentResult = m_runtime->Present(drawData);
|
||||
const auto presentResult = m_runtime->Present(drawData);
|
||||
if (!presentResult.warning.empty()) {
|
||||
LogRuntimeTrace("present", presentResult.warning);
|
||||
}
|
||||
@@ -699,7 +709,7 @@ EditorWindowFrameTransferRequests EditorWindow::RenderRuntimeFrame(
|
||||
const bool useDetachedTitleBarTabStrip =
|
||||
m_chromeController->ShouldUseDetachedTitleBarTabStrip(*this);
|
||||
m_runtime->PrepareEditorContext();
|
||||
const Host::D3D12WindowRenderLoopFrameContext frameContext = m_runtime->BeginFrame();
|
||||
const auto frameContext = m_runtime->BeginFrame();
|
||||
if (!frameContext.warning.empty()) {
|
||||
LogRuntimeTrace("viewport", frameContext.warning);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user