D3D12Device: Fix crash when using media capture
This commit is contained in:
parent
559aff0ad5
commit
de551c1836
|
@ -556,6 +556,7 @@ ID3D12GraphicsCommandList4* D3D12Device::GetInitCommandList()
|
||||||
|
|
||||||
void D3D12Device::SubmitCommandList(bool wait_for_completion)
|
void D3D12Device::SubmitCommandList(bool wait_for_completion)
|
||||||
{
|
{
|
||||||
|
DebugAssert(!InRenderPass());
|
||||||
if (m_device_was_lost) [[unlikely]]
|
if (m_device_was_lost) [[unlikely]]
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -996,9 +996,15 @@ void D3D12DownloadTexture::Flush()
|
||||||
|
|
||||||
// Need to execute command buffer.
|
// Need to execute command buffer.
|
||||||
if (dev.GetCurrentFenceValue() == m_copy_fence_value)
|
if (dev.GetCurrentFenceValue() == m_copy_fence_value)
|
||||||
|
{
|
||||||
|
if (dev.InRenderPass())
|
||||||
|
dev.EndRenderPass();
|
||||||
dev.SubmitCommandList(true);
|
dev.SubmitCommandList(true);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
dev.WaitForFence(m_copy_fence_value);
|
dev.WaitForFence(m_copy_fence_value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void D3D12DownloadTexture::SetDebugName(std::string_view name)
|
void D3D12DownloadTexture::SetDebugName(std::string_view name)
|
||||||
|
|
Loading…
Reference in New Issue