diff --git a/src/core/gpu.cpp b/src/core/gpu.cpp index a5a1b90fa..10e1a45a8 100644 --- a/src/core/gpu.cpp +++ b/src/core/gpu.cpp @@ -76,11 +76,16 @@ void GPU::CPUClockChanged() void GPU::UpdateResolutionScale() {} -std::tuple GPU::GetEffectiveDisplayResolution() +std::tuple GPU::GetEffectiveDisplayResolution(bool scaled /* = true */) { return std::tie(m_crtc_state.display_vram_width, m_crtc_state.display_vram_height); } +std::tuple GPU::GetFullDisplayResolution(bool scaled /* = true */) +{ + return std::tie(m_crtc_state.display_width, m_crtc_state.display_height); +} + void GPU::Reset(bool clear_vram) { SoftReset(); diff --git a/src/core/gpu.h b/src/core/gpu.h index 7a1272dcf..017cfa1d7 100644 --- a/src/core/gpu.h +++ b/src/core/gpu.h @@ -141,7 +141,14 @@ public: virtual void UpdateResolutionScale(); /// Returns the effective display resolution of the GPU. - virtual std::tuple GetEffectiveDisplayResolution(); + virtual std::tuple GetEffectiveDisplayResolution(bool scaled = true); + + /// Returns the full display resolution of the GPU, including padding. + virtual std::tuple GetFullDisplayResolution(bool scaled = true); + + float ComputeHorizontalFrequency() const; + float ComputeVerticalFrequency() const; + float GetDisplayAspectRatio() const; // gpu_hw_d3d11.cpp static std::unique_ptr CreateHardwareD3D11Renderer(); @@ -195,9 +202,6 @@ protected: void SoftReset(); // Sets dots per scanline - float ComputeHorizontalFrequency() const; - float ComputeVerticalFrequency() const; - float GetDisplayAspectRatio() const; void UpdateCRTCConfig(); void UpdateCRTCDisplayParameters(); diff --git a/src/core/gpu_hw.cpp b/src/core/gpu_hw.cpp index e3b4efa37..ddb8fa89d 100644 --- a/src/core/gpu_hw.cpp +++ b/src/core/gpu_hw.cpp @@ -261,10 +261,16 @@ GPUDownsampleMode GPU_HW::GetDownsampleMode(u32 resolution_scale) const return g_settings.gpu_downsample_mode; } -std::tuple GPU_HW::GetEffectiveDisplayResolution() +std::tuple GPU_HW::GetEffectiveDisplayResolution(bool scaled /* = true */) { - return std::make_tuple(m_crtc_state.display_vram_width * m_resolution_scale, - m_resolution_scale * m_crtc_state.display_vram_height); + const u32 scale = scaled ? m_resolution_scale : 1u; + return std::make_tuple(m_crtc_state.display_vram_width * scale, m_crtc_state.display_vram_height * scale); +} + +std::tuple GPU_HW::GetFullDisplayResolution(bool scaled /* = true */) +{ + const u32 scale = scaled ? m_resolution_scale : 1u; + return std::make_tuple(m_crtc_state.display_width * scale, m_crtc_state.display_height * scale); } void GPU_HW::PrintSettingsToLog() diff --git a/src/core/gpu_hw.h b/src/core/gpu_hw.h index 689176537..d609e4266 100644 --- a/src/core/gpu_hw.h +++ b/src/core/gpu_hw.h @@ -38,7 +38,8 @@ public: virtual bool DoState(StateWrapper& sw, HostDisplayTexture** host_texture, bool update_display) override; void UpdateResolutionScale() override final; - std::tuple GetEffectiveDisplayResolution() override final; + std::tuple GetEffectiveDisplayResolution(bool scaled = true) override final; + std::tuple GetFullDisplayResolution(bool scaled = true) override final; protected: enum : u32