rsx: Add toggle for zcull sync behaviour - Adds a relaxed sync mode where ZCULL reports are lazily nudged into flushing and the main core does not actually wait for the event to finish before proceeding - Can drastically improve performance in cases where the game actually does not utilize the report data

This commit is contained in:
kd-11 2019-12-11 19:28:31 +03:00 committed by kd-11
parent 9f94a6dc11
commit fdb638436f
3 changed files with 18 additions and 10 deletions

View File

@ -2195,8 +2195,19 @@ namespace rsx
}
void thread::sync()
{
if (zcull_ctrl->has_pending())
{
if (g_cfg.video.relaxed_zcull_sync)
{
// Emit zcull sync hint and update; guarantees results to be written shortly after this event
zcull_ctrl->update(this, 0, true);
}
else
{
zcull_ctrl->sync(this);
}
}
// Fragment constants may have been updated
m_graphics_state |= rsx::pipeline_state::fragment_constants_dirty;
@ -2433,16 +2444,12 @@ namespace rsx
Emu.Pause();
}
// Reset zcull ctrl
// Reset ZCULL ctrl
// NOTE: A semaphore release is part of RSX flip control and will handle ZCULL sync
// TODO: These routines belong in the state reset routines controlled by sys_rsx and cellGcmSetFlip
zcull_ctrl->set_active(this, false, true);
zcull_ctrl->clear(this);
if (zcull_ctrl->has_pending())
{
LOG_TRACE(RSX, "Dangling reports found, discarding...");
zcull_ctrl->sync(this);
}
// Save current state
m_queued_flip.stats = m_frame_stats;
m_queued_flip.push(buffer);

View File

@ -560,8 +560,8 @@ VKGSRender::VKGSRender() : GSRender()
// Confirmed in BLES01916 (The Evil Within) which uses RGB565 for some virtual texturing data.
backend_config.supports_hw_renormalization = (vk::get_driver_vendor() == vk::driver_vendor::NVIDIA);
// Stub
backend_config.supports_hw_conditional_render = true;
// Relaxed query synchronization
backend_config.supports_hw_conditional_render = !!g_cfg.video.relaxed_zcull_sync;
}
VKGSRender::~VKGSRender()

View File

@ -497,6 +497,7 @@ struct cfg_root : cfg::node
cfg::_bool strict_texture_flushing{this, "Strict Texture Flushing", false};
cfg::_bool disable_native_float16{this, "Disable native float16 support", false};
cfg::_bool multithreaded_rsx{this, "Multithreaded RSX", false};
cfg::_bool relaxed_zcull_sync{this, "Relaxed ZCULL Sync", false};
cfg::_int<1, 8> consequtive_frames_to_draw{this, "Consecutive Frames To Draw", 1};
cfg::_int<1, 8> consequtive_frames_to_skip{this, "Consecutive Frames To Skip", 1};
cfg::_int<50, 800> resolution_scale_percent{this, "Resolution Scale", 100};