mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-08-07 08:39:28 +00:00
Add Stretch to Display Area option (#2961)
This commit is contained in:
parent
41d921808b
commit
2e47c42367
5 changed files with 35 additions and 24 deletions
|
@ -1002,19 +1002,22 @@ void GLGSRender::flip(int buffer)
|
||||||
sizei csize(m_frame->client_width(), m_frame->client_height());
|
sizei csize(m_frame->client_width(), m_frame->client_height());
|
||||||
sizei new_size = csize;
|
sizei new_size = csize;
|
||||||
|
|
||||||
const double aq = (double)buffer_width / buffer_height;
|
if (!g_cfg.video.stretch_to_display_area)
|
||||||
const double rq = (double)new_size.width / new_size.height;
|
{
|
||||||
const double q = aq / rq;
|
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)
|
if (q > 1.0)
|
||||||
{
|
{
|
||||||
new_size.height = int(new_size.height / q);
|
new_size.height = int(new_size.height / q);
|
||||||
aspect_ratio.y = (csize.height - new_size.height) / 2;
|
aspect_ratio.y = (csize.height - new_size.height) / 2;
|
||||||
}
|
}
|
||||||
else if (q < 1.0)
|
else if (q < 1.0)
|
||||||
{
|
{
|
||||||
new_size.width = int(new_size.width * q);
|
new_size.width = int(new_size.width * q);
|
||||||
aspect_ratio.x = (csize.width - new_size.width) / 2;
|
aspect_ratio.x = (csize.width - new_size.width) / 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
aspect_ratio.size = new_size;
|
aspect_ratio.size = new_size;
|
||||||
|
|
|
@ -2013,19 +2013,22 @@ void VKGSRender::flip(int buffer)
|
||||||
sizei csize = { m_frame->client_width(), m_frame->client_height() };
|
sizei csize = { m_frame->client_width(), m_frame->client_height() };
|
||||||
sizei new_size = csize;
|
sizei new_size = csize;
|
||||||
|
|
||||||
const double aq = (double)buffer_width / buffer_height;
|
if (!g_cfg.video.stretch_to_display_area)
|
||||||
const double rq = (double)new_size.width / new_size.height;
|
{
|
||||||
const double q = aq / rq;
|
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)
|
if (q > 1.0)
|
||||||
{
|
{
|
||||||
new_size.height = int(new_size.height / q);
|
new_size.height = int(new_size.height / q);
|
||||||
aspect_ratio.y = (csize.height - new_size.height) / 2;
|
aspect_ratio.y = (csize.height - new_size.height) / 2;
|
||||||
}
|
}
|
||||||
else if (q < 1.0)
|
else if (q < 1.0)
|
||||||
{
|
{
|
||||||
new_size.width = int(new_size.width * q);
|
new_size.width = int(new_size.width * q);
|
||||||
aspect_ratio.x = (csize.width - new_size.width) / 2;
|
aspect_ratio.x = (csize.width - new_size.width) / 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
aspect_ratio.size = new_size;
|
aspect_ratio.size = new_size;
|
||||||
|
|
|
@ -310,6 +310,7 @@ struct cfg_root : cfg::node
|
||||||
cfg::_bool overlay{this, "Debug overlay"};
|
cfg::_bool overlay{this, "Debug overlay"};
|
||||||
cfg::_bool gl_legacy_buffers{this, "Use Legacy OpenGL Buffers"};
|
cfg::_bool gl_legacy_buffers{this, "Use Legacy OpenGL Buffers"};
|
||||||
cfg::_bool use_gpu_texture_scaling{this, "Use GPU texture scaling", true};
|
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 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 invalidate_surface_cache_every_frame{this, "Invalidate Cache Every Frame", true};
|
||||||
cfg::_bool strict_rendering_mode{this, "Strict Rendering Mode"};
|
cfg::_bool strict_rendering_mode{this, "Strict Rendering Mode"};
|
||||||
|
|
|
@ -60,6 +60,7 @@ public:
|
||||||
DebugOverlay,
|
DebugOverlay,
|
||||||
LegacyBuffers,
|
LegacyBuffers,
|
||||||
GPUTextureScaling,
|
GPUTextureScaling,
|
||||||
|
StretchToDisplayArea,
|
||||||
D3D12Adapter,
|
D3D12Adapter,
|
||||||
VulkanAdapter,
|
VulkanAdapter,
|
||||||
ForceHighpZ,
|
ForceHighpZ,
|
||||||
|
@ -152,6 +153,7 @@ private:
|
||||||
{ DebugOverlay, { "Video", "Debug overlay"}},
|
{ DebugOverlay, { "Video", "Debug overlay"}},
|
||||||
{ LegacyBuffers, { "Video", "Use Legacy OpenGL Buffers"}},
|
{ LegacyBuffers, { "Video", "Use Legacy OpenGL Buffers"}},
|
||||||
{ GPUTextureScaling,{ "Video", "Use GPU texture scaling"}},
|
{ GPUTextureScaling,{ "Video", "Use GPU texture scaling"}},
|
||||||
|
{ StretchToDisplayArea, { "Video", "Stretch To Display Area"}},
|
||||||
{ ForceHighpZ, { "Video", "Force High Precision Z buffer"}},
|
{ ForceHighpZ, { "Video", "Force High Precision Z buffer"}},
|
||||||
{ AutoInvalidateCache, { "Video", "Invalidate Cache Every Frame"}},
|
{ AutoInvalidateCache, { "Video", "Invalidate Cache Every Frame"}},
|
||||||
{ StrictRenderingMode, { "Video", "Strict Rendering Mode"}},
|
{ StrictRenderingMode, { "Video", "Strict Rendering Mode"}},
|
||||||
|
|
|
@ -235,6 +235,7 @@ graphics_tab::graphics_tab(std::shared_ptr<emu_settings> xSettings, Render_Creat
|
||||||
QCheckBox *logProg = xemu_settings->CreateEnhancedCheckBox(emu_settings::LogShaderPrograms, this);
|
QCheckBox *logProg = xemu_settings->CreateEnhancedCheckBox(emu_settings::LogShaderPrograms, this);
|
||||||
QCheckBox *vsync = xemu_settings->CreateEnhancedCheckBox(emu_settings::VSync, this);
|
QCheckBox *vsync = xemu_settings->CreateEnhancedCheckBox(emu_settings::VSync, this);
|
||||||
QCheckBox *gpuTextureScaling = xemu_settings->CreateEnhancedCheckBox(emu_settings::GPUTextureScaling, 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 *forceHighpZ = xemu_settings->CreateEnhancedCheckBox(emu_settings::ForceHighpZ, this);
|
||||||
QCheckBox *autoInvalidateCache = xemu_settings->CreateEnhancedCheckBox(emu_settings::AutoInvalidateCache, this);
|
QCheckBox *autoInvalidateCache = xemu_settings->CreateEnhancedCheckBox(emu_settings::AutoInvalidateCache, this);
|
||||||
QCheckBox *scrictModeRendering = xemu_settings->CreateEnhancedCheckBox(emu_settings::StrictRenderingMode, this);
|
QCheckBox *scrictModeRendering = xemu_settings->CreateEnhancedCheckBox(emu_settings::StrictRenderingMode, this);
|
||||||
|
@ -269,6 +270,7 @@ graphics_tab::graphics_tab(std::shared_ptr<emu_settings> xSettings, Render_Creat
|
||||||
vbox22->addWidget(vsync);
|
vbox22->addWidget(vsync);
|
||||||
vbox22->addWidget(autoInvalidateCache);
|
vbox22->addWidget(autoInvalidateCache);
|
||||||
vbox22->addWidget(gpuTextureScaling);
|
vbox22->addWidget(gpuTextureScaling);
|
||||||
|
vbox22->addWidget(stretchToDisplayArea);
|
||||||
vbox22->addSpacing(20);
|
vbox22->addSpacing(20);
|
||||||
|
|
||||||
hbox2->addLayout(vbox21);
|
hbox2->addLayout(vbox21);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue