rsx: Flip workarounds for applications that flip via syscall

- Do not assume flip marks end-of-frame if executed via syscall
- Also disables skip_frame for these applications as there is no frame boundary
- NOTE: QUEUE_HEAD cannot be relied on as it is seemingly possible to flip the same head and not need to queue it
This commit is contained in:
kd-11 2018-11-30 14:39:15 +03:00 committed by kd-11
parent 2168159d03
commit ec768afbd9
3 changed files with 47 additions and 26 deletions

View file

@ -201,6 +201,13 @@ namespace rsx
} }
} }
void flattening_helper::force_disable()
{
enabled = false;
num_collapsed = 0;
fifo_hint = optimization_hint::load_unoptimizable;
}
void flattening_helper::evaluate_performance(u32 total_draw_count) void flattening_helper::evaluate_performance(u32 total_draw_count)
{ {
if (!enabled) if (!enabled)

View file

@ -82,6 +82,7 @@ namespace rsx
u32 get_primitive() const { return deferred_primitive; } u32 get_primitive() const { return deferred_primitive; }
bool is_enabled() const { return enabled; } bool is_enabled() const { return enabled; }
void force_disable();
void evaluate_performance(u32 total_draw_count); void evaluate_performance(u32 total_draw_count);
inline flatten_op test(register_pair& command); inline flatten_op test(register_pair& command);
}; };

View file

@ -2246,13 +2246,46 @@ namespace rsx
void thread::flip(int buffer) void thread::flip(int buffer)
{ {
async_flip_requested.clear(); if (!(async_flip_requested & flip_request::any))
if (!g_cfg.video.disable_FIFO_reordering)
{ {
// Try to enable FIFO optimizations // Flip is processed through inline FLIP command in the commandstream
// Only rarely useful for some games like RE4 // This is critical as it is a reliable end-of-frame marker
m_flattener.evaluate_performance(m_draw_calls);
if (!g_cfg.video.disable_FIFO_reordering)
{
// Try to enable FIFO optimizations
// Only rarely useful for some games like RE4
m_flattener.evaluate_performance(m_draw_calls);
}
// Reset zcull ctrl
zcull_ctrl->set_active(this, false);
zcull_ctrl->clear(this);
if (zcull_ctrl->has_pending())
{
LOG_TRACE(RSX, "Dangling reports found, discarding...");
zcull_ctrl->sync(this);
}
if (g_cfg.video.frame_skip_enabled)
{
m_skip_frame_ctr++;
if (m_skip_frame_ctr == g_cfg.video.consequtive_frames_to_draw)
m_skip_frame_ctr = -g_cfg.video.consequtive_frames_to_skip;
skip_frame = (m_skip_frame_ctr < 0);
}
}
else
{
if (async_flip_requested & flip_request::emu_requested)
{
m_flattener.force_disable();
}
async_flip_requested.clear();
} }
if (!skip_frame) if (!skip_frame)
@ -2261,26 +2294,6 @@ namespace rsx
m_draw_calls = 0; m_draw_calls = 0;
} }
if (g_cfg.video.frame_skip_enabled)
{
m_skip_frame_ctr++;
if (m_skip_frame_ctr == g_cfg.video.consequtive_frames_to_draw)
m_skip_frame_ctr = -g_cfg.video.consequtive_frames_to_skip;
skip_frame = (m_skip_frame_ctr < 0);
}
//Reset zcull ctrl
zcull_ctrl->set_active(this, false);
zcull_ctrl->clear(this);
if (zcull_ctrl->has_pending())
{
LOG_TRACE(RSX, "Dangling reports found, discarding...");
zcull_ctrl->sync(this);
}
performance_counters.sampled_frames++; performance_counters.sampled_frames++;
} }