From 437d3fbb4bc1350355d44483d3f469314ec78e30 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Fri, 14 May 2021 03:36:25 +1000 Subject: [PATCH] GPU/SW: Set display parameters before data --- src/core/gpu_sw.cpp | 14 +++++++------- src/core/gpu_sw.h | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/core/gpu_sw.cpp b/src/core/gpu_sw.cpp index 48dbf3e6b..f3bfe7831 100644 --- a/src/core/gpu_sw.cpp +++ b/src/core/gpu_sw.cpp @@ -492,6 +492,11 @@ void GPU_SW::UpdateDisplay() return; } + m_host_display->SetDisplayParameters(m_crtc_state.display_width, m_crtc_state.display_height, + m_crtc_state.display_origin_left, m_crtc_state.display_origin_top, + m_crtc_state.display_vram_width, m_crtc_state.display_vram_height, + GetDisplayAspectRatio()); + const u32 vram_offset_y = m_crtc_state.display_vram_top; const u32 display_width = m_crtc_state.display_vram_width; const u32 display_height = m_crtc_state.display_vram_height; @@ -525,11 +530,6 @@ void GPU_SW::UpdateDisplay() display_height, 0, false, false); } } - - m_host_display->SetDisplayParameters(m_crtc_state.display_width, m_crtc_state.display_height, - m_crtc_state.display_origin_left, m_crtc_state.display_origin_top, - m_crtc_state.display_vram_width, m_crtc_state.display_vram_height, - GetDisplayAspectRatio()); } else { @@ -539,7 +539,7 @@ void GPU_SW::UpdateDisplay() } } -void GPU_SW::FillBackendCommandParameters(GPUBackendCommand* cmd) +void GPU_SW::FillBackendCommandParameters(GPUBackendCommand* cmd) const { cmd->params.bits = 0; cmd->params.check_mask_before_draw = m_GPUSTAT.check_mask_before_draw; @@ -548,7 +548,7 @@ void GPU_SW::FillBackendCommandParameters(GPUBackendCommand* cmd) cmd->params.interlaced_rendering = IsInterlacedRenderingEnabled(); } -void GPU_SW::FillDrawCommand(GPUBackendDrawCommand* cmd, GPURenderCommand rc) +void GPU_SW::FillDrawCommand(GPUBackendDrawCommand* cmd, GPURenderCommand rc) const { FillBackendCommandParameters(cmd); cmd->rc.bits = rc.bits; diff --git a/src/core/gpu_sw.h b/src/core/gpu_sw.h index c59db3584..6ba407e35 100644 --- a/src/core/gpu_sw.h +++ b/src/core/gpu_sw.h @@ -44,8 +44,8 @@ protected: void DispatchRenderCommand() override; - void FillBackendCommandParameters(GPUBackendCommand* cmd); - void FillDrawCommand(GPUBackendDrawCommand* cmd, GPURenderCommand rc); + void FillBackendCommandParameters(GPUBackendCommand* cmd) const; + void FillDrawCommand(GPUBackendDrawCommand* cmd, GPURenderCommand rc) const; HeapArray m_display_texture_buffer; HostDisplayPixelFormat m_16bit_display_format = HostDisplayPixelFormat::RGB565;