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,7 +2246,10 @@ namespace rsx
void thread::flip(int buffer) void thread::flip(int buffer)
{ {
async_flip_requested.clear(); if (!(async_flip_requested & flip_request::any))
{
// Flip is processed through inline FLIP command in the commandstream
// This is critical as it is a reliable end-of-frame marker
if (!g_cfg.video.disable_FIFO_reordering) if (!g_cfg.video.disable_FIFO_reordering)
{ {
@ -2255,10 +2258,14 @@ namespace rsx
m_flattener.evaluate_performance(m_draw_calls); m_flattener.evaluate_performance(m_draw_calls);
} }
if (!skip_frame) // Reset zcull ctrl
zcull_ctrl->set_active(this, false);
zcull_ctrl->clear(this);
if (zcull_ctrl->has_pending())
{ {
// Reset counter LOG_TRACE(RSX, "Dangling reports found, discarding...");
m_draw_calls = 0; zcull_ctrl->sync(this);
} }
if (g_cfg.video.frame_skip_enabled) if (g_cfg.video.frame_skip_enabled)
@ -2270,15 +2277,21 @@ namespace rsx
skip_frame = (m_skip_frame_ctr < 0); skip_frame = (m_skip_frame_ctr < 0);
} }
}
//Reset zcull ctrl else
zcull_ctrl->set_active(this, false);
zcull_ctrl->clear(this);
if (zcull_ctrl->has_pending())
{ {
LOG_TRACE(RSX, "Dangling reports found, discarding..."); if (async_flip_requested & flip_request::emu_requested)
zcull_ctrl->sync(this); {
m_flattener.force_disable();
}
async_flip_requested.clear();
}
if (!skip_frame)
{
// Reset counter
m_draw_calls = 0;
} }
performance_counters.sampled_frames++; performance_counters.sampled_frames++;