vk: Check frame descriptors before rendering in case of a flip request between begin() and end()

- There is no reason to delay async flip requests since most of the work can be handled during rendering anyway
This commit is contained in:
kd-11 2019-09-28 20:29:55 +03:00 committed by kd-11
parent 1464069476
commit 69c090b14a
1 changed files with 22 additions and 24 deletions

View File

@ -925,30 +925,6 @@ void VKGSRender::begin()
return;
init_buffers(rsx::framebuffer_creation_context::context_draw);
if (!framebuffer_status_valid)
return;
if (m_current_frame->flags & frame_context_state::dirty)
{
check_present_status();
if (m_current_frame->swap_command_buffer)
{
// Borrow time by using the auxilliary context
m_aux_frame_context.grab_resources(*m_current_frame);
m_current_frame = &m_aux_frame_context;
}
else if (m_current_frame->used_descriptors)
{
m_current_frame->descriptor_pool.reset(0);
m_current_frame->used_descriptors = 0;
}
verify(HERE), !m_current_frame->swap_command_buffer;
m_current_frame->flags &= ~frame_context_state::dirty;
}
}
void VKGSRender::update_draw_state()
@ -1206,6 +1182,28 @@ void VKGSRender::end()
return;
}
// Check for frame resource status here because it is possible for an async flip to happen between begin/end
if (UNLIKELY(m_current_frame->flags & frame_context_state::dirty))
{
check_present_status();
if (UNLIKELY(m_current_frame->swap_command_buffer))
{
// Borrow time by using the auxilliary context
m_aux_frame_context.grab_resources(*m_current_frame);
m_current_frame = &m_aux_frame_context;
}
else if (m_current_frame->used_descriptors)
{
m_current_frame->descriptor_pool.reset(0);
m_current_frame->used_descriptors = 0;
}
verify(HERE), !m_current_frame->swap_command_buffer;
m_current_frame->flags &= ~frame_context_state::dirty;
}
m_profiler.start();
// Check for data casts