D3D12Device: Fix crash when using media capture

This commit is contained in:
Stenzek 2024-09-09 17:27:10 +10:00
parent 7dff64eed8
commit d7bca81240
No known key found for this signature in database
2 changed files with 7 additions and 0 deletions

View File

@ -556,6 +556,7 @@ ID3D12GraphicsCommandList4* D3D12Device::GetInitCommandList()
void D3D12Device::SubmitCommandList(bool wait_for_completion)
{
DebugAssert(!InRenderPass());
if (m_device_was_lost) [[unlikely]]
return;

View File

@ -996,10 +996,16 @@ void D3D12DownloadTexture::Flush()
// Need to execute command buffer.
if (dev.GetCurrentFenceValue() == m_copy_fence_value)
{
if (dev.InRenderPass())
dev.EndRenderPass();
dev.SubmitCommandList(true);
}
else
{
dev.WaitForFence(m_copy_fence_value);
}
}
void D3D12DownloadTexture::SetDebugName(std::string_view name)
{