Skip to content

Commit

Permalink
D3D12Device: Fix crash when using media capture
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Sep 9, 2024
1 parent 559aff0 commit de551c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/util/d3d12_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ ID3D12GraphicsCommandList4* D3D12Device::GetInitCommandList()

void D3D12Device::SubmitCommandList(bool wait_for_completion)
{
DebugAssert(!InRenderPass());
if (m_device_was_lost) [[unlikely]]
return;

Expand Down
6 changes: 6 additions & 0 deletions src/util/d3d12_texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit de551c1

Please sign in to comment.