1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-26 04:32:35 +01:00

rsx: Do not discard flip notifications

This commit is contained in:
Eladash 2022-06-25 14:54:05 +03:00 committed by Megamouse
parent f66256cc13
commit 7422ab9e55
3 changed files with 34 additions and 17 deletions

View File

@ -3254,6 +3254,8 @@ namespace rsx
performance_counters.idle_time += delay_us;
}
}
flip_notification_count = 1;
}
else if (frame_limit == frame_limit_type::_ps3)
{
@ -3262,6 +3264,7 @@ namespace rsx
if (vblank_at_flip == umax)
{
vblank_at_flip = +vblank_count;
flip_notification_count = 1;
exit = true;
}
@ -3276,7 +3279,7 @@ namespace rsx
vblank_at_flip = umax;
}
int_flip_index++;
int_flip_index += flip_notification_count;
current_display_buffer = buffer;
m_queued_flip.emu_flip = true;
@ -3289,23 +3292,26 @@ namespace rsx
flip_status = CELL_GCM_DISPLAY_FLIP_STATUS_DONE;
m_queued_flip.in_progress = false;
if (!isHLE)
while (flip_notification_count--)
{
sys_rsx_context_attribute(0x55555555, 0xFEC, buffer, 0, 0, 0);
return;
}
if (!isHLE)
{
sys_rsx_context_attribute(0x55555555, 0xFEC, buffer, 0, 0, 0);
continue;
}
if (auto ptr = flip_handler)
{
intr_thread->cmd_list
({
{ ppu_cmd::set_args, 1 }, u64{ 1 },
{ ppu_cmd::lle_call, ptr },
{ ppu_cmd::sleep, 0 }
});
if (auto ptr = flip_handler)
{
intr_thread->cmd_list
({
{ ppu_cmd::set_args, 1 }, u64{ 1 },
{ ppu_cmd::lle_call, ptr },
{ ppu_cmd::sleep, 0 }
});
intr_thread->cmd_notify++;
intr_thread->cmd_notify.notify_one();
intr_thread->cmd_notify++;
intr_thread->cmd_notify.notify_one();
}
}
}
}

View File

@ -646,6 +646,7 @@ namespace rsx
bool capture_current_frame = false;
u64 vblank_at_flip = umax;
u64 flip_notification_count = 0;
void post_vblank_event(u64 post_event_time);
public:

View File

@ -1770,6 +1770,11 @@ namespace rsx
{
ensure(rsx->isHLE);
if (rsx->vblank_at_flip != umax)
{
rsx->flip_notification_count++;
}
if (auto ptr = rsx->queue_handler)
{
rsx->intr_thread->cmd_list
@ -1818,7 +1823,7 @@ namespace rsx
template<u32 index>
struct driver_flip
{
static void impl(thread*, u32 /*reg*/, u32 arg)
static void impl(thread* rsx, u32 /*reg*/, u32 arg)
{
sys_rsx_context_attribute(0x55555555, 0x102, index, arg, 0, 0);
}
@ -1827,8 +1832,13 @@ namespace rsx
template<u32 index>
struct queue_flip
{
static void impl(thread*, u32 /*reg*/, u32 arg)
static void impl(thread* rsx, u32 /*reg*/, u32 arg)
{
if (rsx->vblank_at_flip != umax)
{
rsx->flip_notification_count++;
}
sys_rsx_context_attribute(0x55555555, 0x103, index, arg, 0, 0);
}
};