mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-26 23:55:40 +00:00
GPU: Add GPU::GetFullDisplayResolution()
This commit is contained in:
parent
a44e9d16fb
commit
628dc36e77
|
@ -76,11 +76,16 @@ void GPU::CPUClockChanged()
|
||||||
|
|
||||||
void GPU::UpdateResolutionScale() {}
|
void GPU::UpdateResolutionScale() {}
|
||||||
|
|
||||||
std::tuple<u32, u32> GPU::GetEffectiveDisplayResolution()
|
std::tuple<u32, u32> GPU::GetEffectiveDisplayResolution(bool scaled /* = true */)
|
||||||
{
|
{
|
||||||
return std::tie(m_crtc_state.display_vram_width, m_crtc_state.display_vram_height);
|
return std::tie(m_crtc_state.display_vram_width, m_crtc_state.display_vram_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::tuple<u32, u32> GPU::GetFullDisplayResolution(bool scaled /* = true */)
|
||||||
|
{
|
||||||
|
return std::tie(m_crtc_state.display_width, m_crtc_state.display_height);
|
||||||
|
}
|
||||||
|
|
||||||
void GPU::Reset(bool clear_vram)
|
void GPU::Reset(bool clear_vram)
|
||||||
{
|
{
|
||||||
SoftReset();
|
SoftReset();
|
||||||
|
|
|
@ -141,7 +141,14 @@ public:
|
||||||
virtual void UpdateResolutionScale();
|
virtual void UpdateResolutionScale();
|
||||||
|
|
||||||
/// Returns the effective display resolution of the GPU.
|
/// Returns the effective display resolution of the GPU.
|
||||||
virtual std::tuple<u32, u32> GetEffectiveDisplayResolution();
|
virtual std::tuple<u32, u32> GetEffectiveDisplayResolution(bool scaled = true);
|
||||||
|
|
||||||
|
/// Returns the full display resolution of the GPU, including padding.
|
||||||
|
virtual std::tuple<u32, u32> GetFullDisplayResolution(bool scaled = true);
|
||||||
|
|
||||||
|
float ComputeHorizontalFrequency() const;
|
||||||
|
float ComputeVerticalFrequency() const;
|
||||||
|
float GetDisplayAspectRatio() const;
|
||||||
|
|
||||||
// gpu_hw_d3d11.cpp
|
// gpu_hw_d3d11.cpp
|
||||||
static std::unique_ptr<GPU> CreateHardwareD3D11Renderer();
|
static std::unique_ptr<GPU> CreateHardwareD3D11Renderer();
|
||||||
|
@ -195,9 +202,6 @@ protected:
|
||||||
void SoftReset();
|
void SoftReset();
|
||||||
|
|
||||||
// Sets dots per scanline
|
// Sets dots per scanline
|
||||||
float ComputeHorizontalFrequency() const;
|
|
||||||
float ComputeVerticalFrequency() const;
|
|
||||||
float GetDisplayAspectRatio() const;
|
|
||||||
void UpdateCRTCConfig();
|
void UpdateCRTCConfig();
|
||||||
void UpdateCRTCDisplayParameters();
|
void UpdateCRTCDisplayParameters();
|
||||||
|
|
||||||
|
|
|
@ -261,10 +261,16 @@ GPUDownsampleMode GPU_HW::GetDownsampleMode(u32 resolution_scale) const
|
||||||
return g_settings.gpu_downsample_mode;
|
return g_settings.gpu_downsample_mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::tuple<u32, u32> GPU_HW::GetEffectiveDisplayResolution()
|
std::tuple<u32, u32> GPU_HW::GetEffectiveDisplayResolution(bool scaled /* = true */)
|
||||||
{
|
{
|
||||||
return std::make_tuple(m_crtc_state.display_vram_width * m_resolution_scale,
|
const u32 scale = scaled ? m_resolution_scale : 1u;
|
||||||
m_resolution_scale * m_crtc_state.display_vram_height);
|
return std::make_tuple(m_crtc_state.display_vram_width * scale, m_crtc_state.display_vram_height * scale);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::tuple<u32, u32> 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()
|
void GPU_HW::PrintSettingsToLog()
|
||||||
|
|
|
@ -38,7 +38,8 @@ public:
|
||||||
virtual bool DoState(StateWrapper& sw, HostDisplayTexture** host_texture, bool update_display) override;
|
virtual bool DoState(StateWrapper& sw, HostDisplayTexture** host_texture, bool update_display) override;
|
||||||
|
|
||||||
void UpdateResolutionScale() override final;
|
void UpdateResolutionScale() override final;
|
||||||
std::tuple<u32, u32> GetEffectiveDisplayResolution() override final;
|
std::tuple<u32, u32> GetEffectiveDisplayResolution(bool scaled = true) override final;
|
||||||
|
std::tuple<u32, u32> GetFullDisplayResolution(bool scaled = true) override final;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
enum : u32
|
enum : u32
|
||||||
|
|
Loading…
Reference in a new issue