From 47138aa9cf008d98e142c7bb2745dc29b6a5d5f6 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Thu, 18 Jun 2020 17:37:11 +1000 Subject: [PATCH] GPU: Consider interlaced rendering for GPU timings Fixes menu screen flickering in Chrono Cross, summary screen breakage in Mr. Driller G. --- src/core/gpu.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/core/gpu.h b/src/core/gpu.h index 6aebc1abc..bf112a0b6 100644 --- a/src/core/gpu.h +++ b/src/core/gpu.h @@ -423,6 +423,8 @@ protected: ticks_per_row += average_width; if (semitransparent || m_GPUSTAT.check_mask_before_draw) ticks_per_row += (average_width + 1u) / 2u; + if (IsInterlacedRenderingEnabled()) + height = std::max(height / 2, 1u); AddCommandTicks(ticks_per_row * height); } @@ -433,10 +435,18 @@ protected: ticks_per_row += width; if (semitransparent || m_GPUSTAT.check_mask_before_draw) ticks_per_row += (width + 1u) / 2u; + if (IsInterlacedRenderingEnabled()) + height = std::max(height / 2, 1u); AddCommandTicks(ticks_per_row * height); } - ALWAYS_INLINE void AddDrawLineTicks(u32 width, u32 height, bool shaded) { AddCommandTicks(std::max(width, height)); } + ALWAYS_INLINE void AddDrawLineTicks(u32 width, u32 height, bool shaded) + { + if (IsInterlacedRenderingEnabled()) + height = std::max(height / 2, 1u); + + AddCommandTicks(std::max(width, height)); + } HostDisplay* m_host_display = nullptr; System* m_system = nullptr;