mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-05-08 04:02:40 +00:00
VideoCommon: Remember to flush command buffers after multiple EFB copies
This commit is contained in:
parent
ec7bf7d1ec
commit
3ee4b89a46
2 changed files with 17 additions and 0 deletions
|
@ -757,6 +757,16 @@ void VertexManagerBase::OnDraw()
|
|||
{
|
||||
m_draw_counter++;
|
||||
|
||||
// If the last efb copy was too close to the one before it, don't forget about it until the next
|
||||
// efb copy happens (which might not be for a long time)
|
||||
u32 diff = m_draw_counter - m_last_efb_copy_draw_counter;
|
||||
if (m_unflushed_efb_copy && diff > MINIMUM_DRAW_CALLS_PER_COMMAND_BUFFER_FOR_READBACK)
|
||||
{
|
||||
g_renderer->Flush();
|
||||
m_unflushed_efb_copy = false;
|
||||
m_last_efb_copy_draw_counter = m_draw_counter;
|
||||
}
|
||||
|
||||
// If we didn't have any CPU access last frame, do nothing.
|
||||
if (m_scheduled_command_buffer_kicks.empty() || !m_allow_background_execution)
|
||||
return;
|
||||
|
@ -768,6 +778,8 @@ void VertexManagerBase::OnDraw()
|
|||
{
|
||||
// Kick a command buffer on the background thread.
|
||||
g_renderer->Flush();
|
||||
m_unflushed_efb_copy = false;
|
||||
m_last_efb_copy_draw_counter = m_draw_counter;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -794,8 +806,12 @@ void VertexManagerBase::OnEFBCopyToRAM()
|
|||
const u32 diff = m_draw_counter - m_last_efb_copy_draw_counter;
|
||||
m_last_efb_copy_draw_counter = m_draw_counter;
|
||||
if (diff < MINIMUM_DRAW_CALLS_PER_COMMAND_BUFFER_FOR_READBACK)
|
||||
{
|
||||
m_unflushed_efb_copy = true;
|
||||
return;
|
||||
}
|
||||
|
||||
m_unflushed_efb_copy = false;
|
||||
g_renderer->Flush();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue