Execute viewport offscreen frames through D3D12 host

This commit is contained in:
2026-04-12 23:21:59 +08:00
parent 941034b387
commit dd3731ba66
7 changed files with 69 additions and 6 deletions

View File

@@ -174,6 +174,24 @@ bool D3D12WindowRenderer::BeginFrame() {
return true;
}
bool D3D12WindowRenderer::SubmitFrame(bool presentSwapChain) {
if (m_commandList == nullptr || m_commandQueue == nullptr) {
return false;
}
if (presentSwapChain && m_swapChain == nullptr) {
return false;
}
m_commandList->Close();
void* commandLists[] = { m_commandList };
m_commandQueue->ExecuteCommandLists(1, commandLists);
if (presentSwapChain) {
m_swapChain->Present(1, 0);
}
return true;
}
ID3D12Device* D3D12WindowRenderer::GetDevice() const {
const D3D12Device* device = GetD3D12Device();
return device != nullptr ? device->GetDevice() : nullptr;