rsx: Trivial non-blocking display synchronization

This commit is contained in:
kd-11 2022-05-21 13:05:35 +03:00 committed by kd-11
parent 1be36fe6a9
commit d52bb78d2c
4 changed files with 37 additions and 6 deletions

View file

@ -3099,6 +3099,18 @@ namespace rsx
Emu.Pause();
}
if (false && wait_for_flip_sema) // Breaks framepacing
{
const auto& value = vm::_ref<RsxSemaphore>(device_addr + 0x30).val;
while (value != flip_sema_wait_val && !test_stopped())
{
_mm_pause();
}
wait_for_flip_sema = false;
m_eng_interrupt_mask |= rsx::display_interrupt;
}
if (zcull_ctrl->has_pending())
{
// NOTE: This is a workaround for buggy games.
@ -3195,7 +3207,7 @@ namespace rsx
case frame_limit_type::_50: limit = 50.; break;
case frame_limit_type::_60: limit = 60.; break;
case frame_limit_type::_30: limit = 30.; break;
case frame_limit_type::_auto: limit = 0.; break; // Handled in RSX semaphore_acquire
case frame_limit_type::_auto: limit = 0.; break;
default:
break;
}
@ -3231,6 +3243,18 @@ namespace rsx
}
}
}
else if (wait_for_flip_sema)
{
const auto& value = vm::_ref<RsxSemaphore>(device_addr + 0x30).val;
if (value != flip_sema_wait_val)
{
// Not yet signaled, handle it later
async_flip_requested |= flip_request::emu_requested;
return;
}
wait_for_flip_sema = false;
}
int_flip_index++;