From 052725fdc7c6ef96dda5efdaf6302c2317483bdd Mon Sep 17 00:00:00 2001 From: kd-11 Date: Sun, 31 Jul 2022 15:21:46 +0300 Subject: [PATCH] rsx: Do not require ZCULL buffer binding to enable ZPASS counting - ZPASS data is still accessible in unbuffered mode. The only thing that buffered ZCULL enables is something closer to early-Z where large blocks of pixels can be dicarded earlier. It is strictly a performance optimization and not required for ZPASS to work. - Update ZCULL stat calculations to take into account unbuffered Z --- rpcs3/Emu/RSX/RSXZCULL.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rpcs3/Emu/RSX/RSXZCULL.cpp b/rpcs3/Emu/RSX/RSXZCULL.cpp index a0ef29bbba..defcfe765d 100644 --- a/rpcs3/Emu/RSX/RSXZCULL.cpp +++ b/rpcs3/Emu/RSX/RSXZCULL.cpp @@ -75,7 +75,7 @@ namespace rsx { // NOTE: Only enable host queries if pixel count is active to save on resources // Can optionally be enabled for either stats enabled or zpass enabled for accuracy - const bool data_stream_available = write_enabled && (zpass_count_enabled /*|| stats_enabled*/); + const bool data_stream_available = zpass_count_enabled; // write_enabled && (zpass_count_enabled || stats_enabled); if (host_queries_active && !data_stream_available) { // Stop @@ -312,14 +312,14 @@ namespace rsx } break; case CELL_GCM_ZCULL_STATS3: - value = value ? 0 : u16{ umax }; + value = (value || !write_enabled || !stats_enabled) ? 0 : u16{ umax }; break; case CELL_GCM_ZCULL_STATS2: case CELL_GCM_ZCULL_STATS1: case CELL_GCM_ZCULL_STATS: default: //Not implemented - value = -1; + value = (write_enabled && stats_enabled) ? -1 : 0; break; }