rsx: Flush FIFO GET before smeaphore_acquire

This commit is contained in:
Eladash 2019-09-29 20:54:33 +03:00 committed by kd-11
parent 70b4ae6bd6
commit 0b2fa6ffdc
3 changed files with 12 additions and 3 deletions

View File

@ -2334,6 +2334,12 @@ namespace rsx
//verify (HERE), async_tasks_pending.load() == 0;
}
void thread::flush_fifo()
{
// Make sure GET value is exposed before sync points
fifo_ctrl->sync_get();
}
void thread::read_barrier(u32 memory_address, u32 memory_range)
{
zcull_ctrl->read_barrier(this, memory_address, memory_range);

View File

@ -518,6 +518,7 @@ namespace rsx
u32 restore_point = 0;
atomic_t<bool> external_interrupt_lock{ false };
atomic_t<bool> external_interrupt_ack{ false };
void flush_fifo();
// Performance approximation counters
struct

View File

@ -65,13 +65,15 @@ namespace rsx
rsx->sync_point_request = true;
const u32 addr = get_address(method_registers.semaphore_offset_406e(), method_registers.semaphore_context_dma_406e());
const auto& sema = vm::_ref<atomic_t<be_t<u32>>>(addr);
const auto& sema = vm::_ref<atomic_be_t<u32>>(addr);
// TODO: Remove vblank semaphore hack
if (sema.load() == arg || addr == rsx->ctxt_addr + 0x30) return;
if (sema == arg || addr == rsx->ctxt_addr + 0x30) return;
rsx->flush_fifo();
u64 start = get_system_time();
while (sema.load() != arg)
while (sema != arg)
{
if (Emu.IsStopped())
return;