mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-15 22:54:00 +00:00
yuzu/frontend: Remove internal resolution option
This commit is contained in:
parent
1b64fae912
commit
03fad5ebe8
9 changed files with 3 additions and 113 deletions
|
@ -437,7 +437,7 @@ struct Values {
|
||||||
bool renderer_debug;
|
bool renderer_debug;
|
||||||
int vulkan_device;
|
int vulkan_device;
|
||||||
|
|
||||||
float resolution_factor;
|
u16 resolution_factor{1};
|
||||||
int aspect_ratio;
|
int aspect_ratio;
|
||||||
int max_anisotropy;
|
int max_anisotropy;
|
||||||
bool use_frame_limit;
|
bool use_frame_limit;
|
||||||
|
|
|
@ -629,13 +629,11 @@ void Config::ReadRendererValues() {
|
||||||
static_cast<Settings::RendererBackend>(ReadSetting(QStringLiteral("backend"), 0).toInt());
|
static_cast<Settings::RendererBackend>(ReadSetting(QStringLiteral("backend"), 0).toInt());
|
||||||
Settings::values.renderer_debug = ReadSetting(QStringLiteral("debug"), false).toBool();
|
Settings::values.renderer_debug = ReadSetting(QStringLiteral("debug"), false).toBool();
|
||||||
Settings::values.vulkan_device = ReadSetting(QStringLiteral("vulkan_device"), 0).toInt();
|
Settings::values.vulkan_device = ReadSetting(QStringLiteral("vulkan_device"), 0).toInt();
|
||||||
Settings::values.resolution_factor =
|
|
||||||
ReadSetting(QStringLiteral("resolution_factor"), 1.0).toFloat();
|
|
||||||
Settings::values.aspect_ratio = ReadSetting(QStringLiteral("aspect_ratio"), 0).toInt();
|
Settings::values.aspect_ratio = ReadSetting(QStringLiteral("aspect_ratio"), 0).toInt();
|
||||||
Settings::values.max_anisotropy = ReadSetting(QStringLiteral("max_anisotropy"), 0).toInt();
|
Settings::values.max_anisotropy = ReadSetting(QStringLiteral("max_anisotropy"), 0).toInt();
|
||||||
Settings::values.use_frame_limit =
|
Settings::values.use_frame_limit =
|
||||||
ReadSetting(QStringLiteral("use_frame_limit"), true).toBool();
|
ReadSetting(QStringLiteral("use_frame_limit"), true).toBool();
|
||||||
Settings::values.frame_limit = ReadSetting(QStringLiteral("frame_limit"), 100).toInt();
|
Settings::values.frame_limit = ReadSetting(QStringLiteral("frame_limit"), 100).toUInt();
|
||||||
Settings::values.use_disk_shader_cache =
|
Settings::values.use_disk_shader_cache =
|
||||||
ReadSetting(QStringLiteral("use_disk_shader_cache"), true).toBool();
|
ReadSetting(QStringLiteral("use_disk_shader_cache"), true).toBool();
|
||||||
const int gpu_accuracy_level = ReadSetting(QStringLiteral("gpu_accuracy"), 0).toInt();
|
const int gpu_accuracy_level = ReadSetting(QStringLiteral("gpu_accuracy"), 0).toInt();
|
||||||
|
@ -720,8 +718,6 @@ void Config::ReadUIValues() {
|
||||||
.toString();
|
.toString();
|
||||||
UISettings::values.enable_discord_presence =
|
UISettings::values.enable_discord_presence =
|
||||||
ReadSetting(QStringLiteral("enable_discord_presence"), true).toBool();
|
ReadSetting(QStringLiteral("enable_discord_presence"), true).toBool();
|
||||||
UISettings::values.screenshot_resolution_factor =
|
|
||||||
static_cast<u16>(ReadSetting(QStringLiteral("screenshot_resolution_factor"), 0).toUInt());
|
|
||||||
UISettings::values.select_user_on_boot =
|
UISettings::values.select_user_on_boot =
|
||||||
ReadSetting(QStringLiteral("select_user_on_boot"), false).toBool();
|
ReadSetting(QStringLiteral("select_user_on_boot"), false).toBool();
|
||||||
|
|
||||||
|
@ -1079,8 +1075,6 @@ void Config::SaveRendererValues() {
|
||||||
WriteSetting(QStringLiteral("backend"), static_cast<int>(Settings::values.renderer_backend), 0);
|
WriteSetting(QStringLiteral("backend"), static_cast<int>(Settings::values.renderer_backend), 0);
|
||||||
WriteSetting(QStringLiteral("debug"), Settings::values.renderer_debug, false);
|
WriteSetting(QStringLiteral("debug"), Settings::values.renderer_debug, false);
|
||||||
WriteSetting(QStringLiteral("vulkan_device"), Settings::values.vulkan_device, 0);
|
WriteSetting(QStringLiteral("vulkan_device"), Settings::values.vulkan_device, 0);
|
||||||
WriteSetting(QStringLiteral("resolution_factor"),
|
|
||||||
static_cast<double>(Settings::values.resolution_factor), 1.0);
|
|
||||||
WriteSetting(QStringLiteral("aspect_ratio"), Settings::values.aspect_ratio, 0);
|
WriteSetting(QStringLiteral("aspect_ratio"), Settings::values.aspect_ratio, 0);
|
||||||
WriteSetting(QStringLiteral("max_anisotropy"), Settings::values.max_anisotropy, 0);
|
WriteSetting(QStringLiteral("max_anisotropy"), Settings::values.max_anisotropy, 0);
|
||||||
WriteSetting(QStringLiteral("use_frame_limit"), Settings::values.use_frame_limit, true);
|
WriteSetting(QStringLiteral("use_frame_limit"), Settings::values.use_frame_limit, true);
|
||||||
|
@ -1156,8 +1150,6 @@ void Config::SaveUIValues() {
|
||||||
QString::fromUtf8(UISettings::themes[0].second));
|
QString::fromUtf8(UISettings::themes[0].second));
|
||||||
WriteSetting(QStringLiteral("enable_discord_presence"),
|
WriteSetting(QStringLiteral("enable_discord_presence"),
|
||||||
UISettings::values.enable_discord_presence, true);
|
UISettings::values.enable_discord_presence, true);
|
||||||
WriteSetting(QStringLiteral("screenshot_resolution_factor"),
|
|
||||||
UISettings::values.screenshot_resolution_factor, 0);
|
|
||||||
WriteSetting(QStringLiteral("select_user_on_boot"), UISettings::values.select_user_on_boot,
|
WriteSetting(QStringLiteral("select_user_on_boot"), UISettings::values.select_user_on_boot,
|
||||||
false);
|
false);
|
||||||
|
|
||||||
|
|
|
@ -19,47 +19,6 @@
|
||||||
#include "video_core/renderer_vulkan/renderer_vulkan.h"
|
#include "video_core/renderer_vulkan/renderer_vulkan.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace {
|
|
||||||
enum class Resolution : int {
|
|
||||||
Auto,
|
|
||||||
Scale1x,
|
|
||||||
Scale2x,
|
|
||||||
Scale3x,
|
|
||||||
Scale4x,
|
|
||||||
};
|
|
||||||
|
|
||||||
float ToResolutionFactor(Resolution option) {
|
|
||||||
switch (option) {
|
|
||||||
case Resolution::Auto:
|
|
||||||
return 0.f;
|
|
||||||
case Resolution::Scale1x:
|
|
||||||
return 1.f;
|
|
||||||
case Resolution::Scale2x:
|
|
||||||
return 2.f;
|
|
||||||
case Resolution::Scale3x:
|
|
||||||
return 3.f;
|
|
||||||
case Resolution::Scale4x:
|
|
||||||
return 4.f;
|
|
||||||
}
|
|
||||||
return 0.f;
|
|
||||||
}
|
|
||||||
|
|
||||||
Resolution FromResolutionFactor(float factor) {
|
|
||||||
if (factor == 0.f) {
|
|
||||||
return Resolution::Auto;
|
|
||||||
} else if (factor == 1.f) {
|
|
||||||
return Resolution::Scale1x;
|
|
||||||
} else if (factor == 2.f) {
|
|
||||||
return Resolution::Scale2x;
|
|
||||||
} else if (factor == 3.f) {
|
|
||||||
return Resolution::Scale3x;
|
|
||||||
} else if (factor == 4.f) {
|
|
||||||
return Resolution::Scale4x;
|
|
||||||
}
|
|
||||||
return Resolution::Auto;
|
|
||||||
}
|
|
||||||
} // Anonymous namespace
|
|
||||||
|
|
||||||
ConfigureGraphics::ConfigureGraphics(QWidget* parent)
|
ConfigureGraphics::ConfigureGraphics(QWidget* parent)
|
||||||
: QWidget(parent), ui(new Ui::ConfigureGraphics) {
|
: QWidget(parent), ui(new Ui::ConfigureGraphics) {
|
||||||
vulkan_device = Settings::values.vulkan_device;
|
vulkan_device = Settings::values.vulkan_device;
|
||||||
|
@ -99,8 +58,6 @@ void ConfigureGraphics::SetConfiguration() {
|
||||||
|
|
||||||
ui->api->setEnabled(runtime_lock);
|
ui->api->setEnabled(runtime_lock);
|
||||||
ui->api->setCurrentIndex(static_cast<int>(Settings::values.renderer_backend));
|
ui->api->setCurrentIndex(static_cast<int>(Settings::values.renderer_backend));
|
||||||
ui->resolution_factor_combobox->setCurrentIndex(
|
|
||||||
static_cast<int>(FromResolutionFactor(Settings::values.resolution_factor)));
|
|
||||||
ui->aspect_ratio_combobox->setCurrentIndex(Settings::values.aspect_ratio);
|
ui->aspect_ratio_combobox->setCurrentIndex(Settings::values.aspect_ratio);
|
||||||
ui->use_disk_shader_cache->setEnabled(runtime_lock);
|
ui->use_disk_shader_cache->setEnabled(runtime_lock);
|
||||||
ui->use_disk_shader_cache->setChecked(Settings::values.use_disk_shader_cache);
|
ui->use_disk_shader_cache->setChecked(Settings::values.use_disk_shader_cache);
|
||||||
|
@ -114,8 +71,6 @@ void ConfigureGraphics::SetConfiguration() {
|
||||||
void ConfigureGraphics::ApplyConfiguration() {
|
void ConfigureGraphics::ApplyConfiguration() {
|
||||||
Settings::values.renderer_backend = GetCurrentGraphicsBackend();
|
Settings::values.renderer_backend = GetCurrentGraphicsBackend();
|
||||||
Settings::values.vulkan_device = vulkan_device;
|
Settings::values.vulkan_device = vulkan_device;
|
||||||
Settings::values.resolution_factor =
|
|
||||||
ToResolutionFactor(static_cast<Resolution>(ui->resolution_factor_combobox->currentIndex()));
|
|
||||||
Settings::values.aspect_ratio = ui->aspect_ratio_combobox->currentIndex();
|
Settings::values.aspect_ratio = ui->aspect_ratio_combobox->currentIndex();
|
||||||
Settings::values.use_disk_shader_cache = ui->use_disk_shader_cache->isChecked();
|
Settings::values.use_disk_shader_cache = ui->use_disk_shader_cache->isChecked();
|
||||||
Settings::values.use_asynchronous_gpu_emulation =
|
Settings::values.use_asynchronous_gpu_emulation =
|
||||||
|
|
|
@ -84,46 +84,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="text">
|
|
||||||
<string>Internal Resolution:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QComboBox" name="resolution_factor_combobox">
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Auto (Window Size)</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Native (1280x720)</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>2x Native (2560x1440)</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>3x Native (3840x2160)</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>4x Native (5120x2880)</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||||
<item>
|
<item>
|
||||||
|
|
|
@ -689,10 +689,7 @@ void GMainWindow::InitializeHotkeys() {
|
||||||
Settings::values.use_frame_limit = !Settings::values.use_frame_limit;
|
Settings::values.use_frame_limit = !Settings::values.use_frame_limit;
|
||||||
UpdateStatusBar();
|
UpdateStatusBar();
|
||||||
});
|
});
|
||||||
// TODO: Remove this comment/static whenever the next major release of
|
constexpr u16 SPEED_LIMIT_STEP = 5;
|
||||||
// MSVC occurs and we make it a requirement (see:
|
|
||||||
// https://developercommunity.visualstudio.com/content/problem/93922/constexprs-are-trying-to-be-captured-in-lambda-fun.html)
|
|
||||||
static constexpr u16 SPEED_LIMIT_STEP = 5;
|
|
||||||
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Increase Speed Limit"), this),
|
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Increase Speed Limit"), this),
|
||||||
&QShortcut::activated, this, [&] {
|
&QShortcut::activated, this, [&] {
|
||||||
if (Settings::values.frame_limit < 9999 - SPEED_LIMIT_STEP) {
|
if (Settings::values.frame_limit < 9999 - SPEED_LIMIT_STEP) {
|
||||||
|
|
|
@ -380,8 +380,6 @@ void Config::ReadValues() {
|
||||||
Settings::values.renderer_debug = sdl2_config->GetBoolean("Renderer", "debug", false);
|
Settings::values.renderer_debug = sdl2_config->GetBoolean("Renderer", "debug", false);
|
||||||
Settings::values.vulkan_device = sdl2_config->GetInteger("Renderer", "vulkan_device", 0);
|
Settings::values.vulkan_device = sdl2_config->GetInteger("Renderer", "vulkan_device", 0);
|
||||||
|
|
||||||
Settings::values.resolution_factor =
|
|
||||||
static_cast<float>(sdl2_config->GetReal("Renderer", "resolution_factor", 1.0));
|
|
||||||
Settings::values.aspect_ratio =
|
Settings::values.aspect_ratio =
|
||||||
static_cast<int>(sdl2_config->GetInteger("Renderer", "aspect_ratio", 0));
|
static_cast<int>(sdl2_config->GetInteger("Renderer", "aspect_ratio", 0));
|
||||||
Settings::values.max_anisotropy =
|
Settings::values.max_anisotropy =
|
||||||
|
|
|
@ -117,11 +117,6 @@ use_hw_renderer =
|
||||||
# 0: Interpreter (slow), 1 (default): JIT (fast)
|
# 0: Interpreter (slow), 1 (default): JIT (fast)
|
||||||
use_shader_jit =
|
use_shader_jit =
|
||||||
|
|
||||||
# Resolution scale factor
|
|
||||||
# 0: Auto (scales resolution to window size), 1: Native Switch screen resolution, Otherwise a scale
|
|
||||||
# factor for the Switch resolution
|
|
||||||
resolution_factor =
|
|
||||||
|
|
||||||
# Aspect ratio
|
# Aspect ratio
|
||||||
# 0: Default (16:9), 1: Force 4:3, 2: Force 21:9, 3: Stretch to Window
|
# 0: Default (16:9), 1: Force 4:3, 2: Force 21:9, 3: Stretch to Window
|
||||||
aspect_ratio =
|
aspect_ratio =
|
||||||
|
|
|
@ -116,8 +116,6 @@ void Config::ReadValues() {
|
||||||
Settings::values.use_multi_core = sdl2_config->GetBoolean("Core", "use_multi_core", false);
|
Settings::values.use_multi_core = sdl2_config->GetBoolean("Core", "use_multi_core", false);
|
||||||
|
|
||||||
// Renderer
|
// Renderer
|
||||||
Settings::values.resolution_factor =
|
|
||||||
static_cast<float>(sdl2_config->GetReal("Renderer", "resolution_factor", 1.0));
|
|
||||||
Settings::values.aspect_ratio =
|
Settings::values.aspect_ratio =
|
||||||
static_cast<int>(sdl2_config->GetInteger("Renderer", "aspect_ratio", 0));
|
static_cast<int>(sdl2_config->GetInteger("Renderer", "aspect_ratio", 0));
|
||||||
Settings::values.max_anisotropy =
|
Settings::values.max_anisotropy =
|
||||||
|
|
|
@ -21,11 +21,6 @@ use_hw_renderer =
|
||||||
# 0: Interpreter (slow), 1 (default): JIT (fast)
|
# 0: Interpreter (slow), 1 (default): JIT (fast)
|
||||||
use_shader_jit =
|
use_shader_jit =
|
||||||
|
|
||||||
# Resolution scale factor
|
|
||||||
# 0: Auto (scales resolution to window size), 1: Native Switch screen resolution, Otherwise a scale
|
|
||||||
# factor for the Switch resolution
|
|
||||||
resolution_factor =
|
|
||||||
|
|
||||||
# Aspect ratio
|
# Aspect ratio
|
||||||
# 0: Default (16:9), 1: Force 4:3, 2: Force 21:9, 3: Stretch to Window
|
# 0: Default (16:9), 1: Force 4:3, 2: Force 21:9, 3: Stretch to Window
|
||||||
aspect_ratio =
|
aspect_ratio =
|
||||||
|
|
Loading…
Reference in a new issue