Execute viewport offscreen frames through D3D12 host
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user