Merge pull request #12171 from Filoppi/support_8k

Add support for resolutions multipliers up to 12x (~8k)
This commit is contained in:
Admiral H. Curtiss 2023-10-06 02:37:36 +02:00 committed by GitHub
commit 1c433d5f3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 12 deletions

View File

@ -76,7 +76,7 @@ const Info<bool> GFX_FAST_DEPTH_CALC{{System::GFX, "Settings", "FastDepthCalc"},
const Info<u32> GFX_MSAA{{System::GFX, "Settings", "MSAA"}, 1}; const Info<u32> GFX_MSAA{{System::GFX, "Settings", "MSAA"}, 1};
const Info<bool> GFX_SSAA{{System::GFX, "Settings", "SSAA"}, false}; const Info<bool> GFX_SSAA{{System::GFX, "Settings", "SSAA"}, false};
const Info<int> GFX_EFB_SCALE{{System::GFX, "Settings", "InternalResolution"}, 1}; const Info<int> GFX_EFB_SCALE{{System::GFX, "Settings", "InternalResolution"}, 1};
const Info<int> GFX_MAX_EFB_SCALE{{System::GFX, "Settings", "MaxInternalResolution"}, 8}; const Info<int> GFX_MAX_EFB_SCALE{{System::GFX, "Settings", "MaxInternalResolution"}, 12};
const Info<bool> GFX_TEXFMT_OVERLAY_ENABLE{{System::GFX, "Settings", "TexFmtOverlayEnable"}, false}; const Info<bool> GFX_TEXFMT_OVERLAY_ENABLE{{System::GFX, "Settings", "TexFmtOverlayEnable"}, false};
const Info<bool> GFX_TEXFMT_OVERLAY_CENTER{{System::GFX, "Settings", "TexFmtOverlayCenter"}, false}; const Info<bool> GFX_TEXFMT_OVERLAY_CENTER{{System::GFX, "Settings", "TexFmtOverlayCenter"}, false};
const Info<bool> GFX_ENABLE_WIREFRAME{{System::GFX, "Settings", "WireFrame"}, false}; const Info<bool> GFX_ENABLE_WIREFRAME{{System::GFX, "Settings", "WireFrame"}, false};

View File

@ -62,13 +62,17 @@ void EnhancementsWidget::CreateWidgets()
auto* enhancements_layout = new QGridLayout(); auto* enhancements_layout = new QGridLayout();
enhancements_box->setLayout(enhancements_layout); enhancements_box->setLayout(enhancements_layout);
// Only display the first 8 scales, which most users will not go beyond. QStringList resolution_options{tr("Auto (Multiple of 640x528)"), tr("Native (640x528)")};
QStringList resolution_options{ // From 2x up.
tr("Auto (Multiple of 640x528)"), tr("Native (640x528)"), // To calculate the suggested internal resolution scale for each common output resolution,
tr("2x Native (1280x1056) for 720p"), tr("3x Native (1920x1584) for 1080p"), // we find the minimum multiplier that results in an equal or greater resolution than the
tr("4x Native (2560x2112) for 1440p"), tr("5x Native (3200x2640)"), // output one, on both width and height.
tr("6x Native (3840x3168) for 4K"), tr("7x Native (4480x3696)"), // Note that often games don't render to the full resolution, but have some black bars
tr("8x Native (5120x4224) for 5K")}; // on the edges; this is not accounted for in the calculations.
const QStringList resolution_extra_options{
tr("720p"), tr("1080p"), tr("1440p"), QStringLiteral(""),
tr("4K"), QStringLiteral(""), tr("5K"), QStringLiteral(""),
QStringLiteral(""), QStringLiteral(""), tr("8K")};
const int visible_resolution_option_count = static_cast<int>(resolution_options.size()); const int visible_resolution_option_count = static_cast<int>(resolution_options.size());
// If the current scale is greater than the max scale in the ini, add sufficient options so that // If the current scale is greater than the max scale in the ini, add sufficient options so that
@ -77,10 +81,22 @@ void EnhancementsWidget::CreateWidgets()
std::max(Config::Get(Config::GFX_EFB_SCALE), Config::Get(Config::GFX_MAX_EFB_SCALE)); std::max(Config::Get(Config::GFX_EFB_SCALE), Config::Get(Config::GFX_MAX_EFB_SCALE));
for (int scale = static_cast<int>(resolution_options.size()); scale <= max_efb_scale; scale++) for (int scale = static_cast<int>(resolution_options.size()); scale <= max_efb_scale; scale++)
{ {
resolution_options.append(tr("%1x Native (%2x%3)") const QString scale_text = QString::number(scale);
.arg(QString::number(scale), const QString width_text = QString::number(static_cast<int>(EFB_WIDTH) * scale);
QString::number(static_cast<int>(EFB_WIDTH) * scale), const QString height_text = QString::number(static_cast<int>(EFB_HEIGHT) * scale);
QString::number(static_cast<int>(EFB_HEIGHT) * scale))); const int extra_index = resolution_options.size() - 2;
const QString extra_text = resolution_extra_options.size() > extra_index ?
resolution_extra_options[extra_index] :
QStringLiteral("");
if (extra_text.isEmpty())
{
resolution_options.append(tr("%1x Native (%2x%3)").arg(scale_text, width_text, height_text));
}
else
{
resolution_options.append(
tr("%1x Native (%2x%3) for %4").arg(scale_text, width_text, height_text, extra_text));
}
} }
m_ir_combo = new ConfigChoice(resolution_options, Config::GFX_EFB_SCALE); m_ir_combo = new ConfigChoice(resolution_options, Config::GFX_EFB_SCALE);