D3D12Device: Fix crash when using media capture
This commit is contained in:
parent
7dff64eed8
commit
d7bca81240
|
@ -556,6 +556,7 @@ ID3D12GraphicsCommandList4* D3D12Device::GetInitCommandList()
|
|||
|
||||
void D3D12Device::SubmitCommandList(bool wait_for_completion)
|
||||
{
|
||||
DebugAssert(!InRenderPass());
|
||||
if (m_device_was_lost) [[unlikely]]
|
||||
return;
|
||||
|
||||
|
|
|
@ -996,9 +996,15 @@ 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)
|
||||
|
|
Loading…
Reference in New Issue