diff --git a/rpcs3/Emu/RSX/GL/GLGSRender.cpp b/rpcs3/Emu/RSX/GL/GLGSRender.cpp index 74494d5226..8953b8075e 100644 --- a/rpcs3/Emu/RSX/GL/GLGSRender.cpp +++ b/rpcs3/Emu/RSX/GL/GLGSRender.cpp @@ -1002,19 +1002,22 @@ void GLGSRender::flip(int buffer) sizei csize(m_frame->client_width(), m_frame->client_height()); sizei new_size = csize; - const double aq = (double)buffer_width / buffer_height; - const double rq = (double)new_size.width / new_size.height; - const double q = aq / rq; + if (!g_cfg.video.stretch_to_display_area) + { + const double aq = (double)buffer_width / buffer_height; + const double rq = (double)new_size.width / new_size.height; + const double q = aq / rq; - if (q > 1.0) - { - new_size.height = int(new_size.height / q); - aspect_ratio.y = (csize.height - new_size.height) / 2; - } - else if (q < 1.0) - { - new_size.width = int(new_size.width * q); - aspect_ratio.x = (csize.width - new_size.width) / 2; + if (q > 1.0) + { + new_size.height = int(new_size.height / q); + aspect_ratio.y = (csize.height - new_size.height) / 2; + } + else if (q < 1.0) + { + new_size.width = int(new_size.width * q); + aspect_ratio.x = (csize.width - new_size.width) / 2; + } } aspect_ratio.size = new_size; diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.cpp b/rpcs3/Emu/RSX/VK/VKGSRender.cpp index 2a652a2954..0a6b893014 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.cpp +++ b/rpcs3/Emu/RSX/VK/VKGSRender.cpp @@ -2013,19 +2013,22 @@ void VKGSRender::flip(int buffer) sizei csize = { m_frame->client_width(), m_frame->client_height() }; sizei new_size = csize; - const double aq = (double)buffer_width / buffer_height; - const double rq = (double)new_size.width / new_size.height; - const double q = aq / rq; + if (!g_cfg.video.stretch_to_display_area) + { + const double aq = (double)buffer_width / buffer_height; + const double rq = (double)new_size.width / new_size.height; + const double q = aq / rq; - if (q > 1.0) - { - new_size.height = int(new_size.height / q); - aspect_ratio.y = (csize.height - new_size.height) / 2; - } - else if (q < 1.0) - { - new_size.width = int(new_size.width * q); - aspect_ratio.x = (csize.width - new_size.width) / 2; + if (q > 1.0) + { + new_size.height = int(new_size.height / q); + aspect_ratio.y = (csize.height - new_size.height) / 2; + } + else if (q < 1.0) + { + new_size.width = int(new_size.width * q); + aspect_ratio.x = (csize.width - new_size.width) / 2; + } } aspect_ratio.size = new_size; diff --git a/rpcs3/Emu/System.h b/rpcs3/Emu/System.h index 78d6260691..51bed307c9 100644 --- a/rpcs3/Emu/System.h +++ b/rpcs3/Emu/System.h @@ -310,6 +310,7 @@ struct cfg_root : cfg::node cfg::_bool overlay{this, "Debug overlay"}; cfg::_bool gl_legacy_buffers{this, "Use Legacy OpenGL Buffers"}; cfg::_bool use_gpu_texture_scaling{this, "Use GPU texture scaling", true}; + cfg::_bool stretch_to_display_area{this, "Stretch To Display Area"}; cfg::_bool force_high_precision_z_buffer{this, "Force High Precision Z buffer"}; cfg::_bool invalidate_surface_cache_every_frame{this, "Invalidate Cache Every Frame", true}; cfg::_bool strict_rendering_mode{this, "Strict Rendering Mode"}; diff --git a/rpcs3/rpcs3qt/emu_settings.h b/rpcs3/rpcs3qt/emu_settings.h index a917a96747..24d446a337 100644 --- a/rpcs3/rpcs3qt/emu_settings.h +++ b/rpcs3/rpcs3qt/emu_settings.h @@ -60,6 +60,7 @@ public: DebugOverlay, LegacyBuffers, GPUTextureScaling, + StretchToDisplayArea, D3D12Adapter, VulkanAdapter, ForceHighpZ, @@ -152,6 +153,7 @@ private: { DebugOverlay, { "Video", "Debug overlay"}}, { LegacyBuffers, { "Video", "Use Legacy OpenGL Buffers"}}, { GPUTextureScaling,{ "Video", "Use GPU texture scaling"}}, + { StretchToDisplayArea, { "Video", "Stretch To Display Area"}}, { ForceHighpZ, { "Video", "Force High Precision Z buffer"}}, { AutoInvalidateCache, { "Video", "Invalidate Cache Every Frame"}}, { StrictRenderingMode, { "Video", "Strict Rendering Mode"}}, diff --git a/rpcs3/rpcs3qt/graphics_tab.cpp b/rpcs3/rpcs3qt/graphics_tab.cpp index 9d4d55921e..efd36063ce 100644 --- a/rpcs3/rpcs3qt/graphics_tab.cpp +++ b/rpcs3/rpcs3qt/graphics_tab.cpp @@ -235,6 +235,7 @@ graphics_tab::graphics_tab(std::shared_ptr xSettings, Render_Creat QCheckBox *logProg = xemu_settings->CreateEnhancedCheckBox(emu_settings::LogShaderPrograms, this); QCheckBox *vsync = xemu_settings->CreateEnhancedCheckBox(emu_settings::VSync, this); QCheckBox *gpuTextureScaling = xemu_settings->CreateEnhancedCheckBox(emu_settings::GPUTextureScaling, this); + QCheckBox *stretchToDisplayArea = xemu_settings->CreateEnhancedCheckBox(emu_settings::StretchToDisplayArea, this); QCheckBox *forceHighpZ = xemu_settings->CreateEnhancedCheckBox(emu_settings::ForceHighpZ, this); QCheckBox *autoInvalidateCache = xemu_settings->CreateEnhancedCheckBox(emu_settings::AutoInvalidateCache, this); QCheckBox *scrictModeRendering = xemu_settings->CreateEnhancedCheckBox(emu_settings::StrictRenderingMode, this); @@ -269,6 +270,7 @@ graphics_tab::graphics_tab(std::shared_ptr xSettings, Render_Creat vbox22->addWidget(vsync); vbox22->addWidget(autoInvalidateCache); vbox22->addWidget(gpuTextureScaling); + vbox22->addWidget(stretchToDisplayArea); vbox22->addSpacing(20); hbox2->addLayout(vbox21);