diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index 19adf61223..e65bf9f495 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -2196,7 +2196,18 @@ namespace rsx void thread::sync() { - zcull_ctrl->sync(this); + 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); diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.cpp b/rpcs3/Emu/RSX/VK/VKGSRender.cpp index 7f09548fd9..9abd349a11 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.cpp +++ b/rpcs3/Emu/RSX/VK/VKGSRender.cpp @@ -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() diff --git a/rpcs3/Emu/System.h b/rpcs3/Emu/System.h index a3c17cbd4f..17e98d40c0 100644 --- a/rpcs3/Emu/System.h +++ b/rpcs3/Emu/System.h @@ -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};