diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/settings.h | 1 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_sampler_cache.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/textures/texture.h | 24 | ||||
| -rw-r--r-- | src/yuzu/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure.ui | 11 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_dialog.cpp | 4 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics.cpp | 8 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics.ui | 24 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics_advanced.cpp | 48 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics_advanced.h | 30 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics_advanced.ui | 111 | ||||
| -rw-r--r-- | src/yuzu_cmd/config.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu_cmd/default_ini.h | 4 | ||||
| -rw-r--r-- | src/yuzu_tester/config.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu_tester/default_ini.h | 4 |
16 files changed, 245 insertions, 35 deletions
diff --git a/src/core/settings.h b/src/core/settings.h index 15b691342..cb5979e6f 100644 --- a/src/core/settings.h +++ b/src/core/settings.h | |||
| @@ -430,6 +430,7 @@ struct Values { | |||
| 430 | 430 | ||
| 431 | float resolution_factor; | 431 | float resolution_factor; |
| 432 | int aspect_ratio; | 432 | int aspect_ratio; |
| 433 | int max_anisotropy; | ||
| 433 | bool use_frame_limit; | 434 | bool use_frame_limit; |
| 434 | u16 frame_limit; | 435 | u16 frame_limit; |
| 435 | bool use_disk_shader_cache; | 436 | bool use_disk_shader_cache; |
diff --git a/src/video_core/renderer_opengl/gl_sampler_cache.cpp b/src/video_core/renderer_opengl/gl_sampler_cache.cpp index 3ded5ecea..5c174879a 100644 --- a/src/video_core/renderer_opengl/gl_sampler_cache.cpp +++ b/src/video_core/renderer_opengl/gl_sampler_cache.cpp | |||
| @@ -38,7 +38,7 @@ OGLSampler SamplerCacheOpenGL::CreateSampler(const Tegra::Texture::TSCEntry& tsc | |||
| 38 | glSamplerParameterf(sampler_id, GL_TEXTURE_MAX_ANISOTROPY, tsc.GetMaxAnisotropy()); | 38 | glSamplerParameterf(sampler_id, GL_TEXTURE_MAX_ANISOTROPY, tsc.GetMaxAnisotropy()); |
| 39 | } else if (GLAD_GL_EXT_texture_filter_anisotropic) { | 39 | } else if (GLAD_GL_EXT_texture_filter_anisotropic) { |
| 40 | glSamplerParameterf(sampler_id, GL_TEXTURE_MAX_ANISOTROPY_EXT, tsc.GetMaxAnisotropy()); | 40 | glSamplerParameterf(sampler_id, GL_TEXTURE_MAX_ANISOTROPY_EXT, tsc.GetMaxAnisotropy()); |
| 41 | } else if (tsc.GetMaxAnisotropy() != 1) { | 41 | } else { |
| 42 | LOG_WARNING(Render_OpenGL, "Anisotropy not supported by host GPU driver"); | 42 | LOG_WARNING(Render_OpenGL, "Anisotropy not supported by host GPU driver"); |
| 43 | } | 43 | } |
| 44 | 44 | ||
diff --git a/src/video_core/textures/texture.h b/src/video_core/textures/texture.h index 8e82c6748..07098c70d 100644 --- a/src/video_core/textures/texture.h +++ b/src/video_core/textures/texture.h | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include "common/assert.h" | 8 | #include "common/assert.h" |
| 9 | #include "common/bit_field.h" | 9 | #include "common/bit_field.h" |
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | #include "core/settings.h" | ||
| 11 | 12 | ||
| 12 | namespace Tegra::Texture { | 13 | namespace Tegra::Texture { |
| 13 | 14 | ||
| @@ -294,6 +295,14 @@ enum class TextureMipmapFilter : u32 { | |||
| 294 | Linear = 3, | 295 | Linear = 3, |
| 295 | }; | 296 | }; |
| 296 | 297 | ||
| 298 | enum class Anisotropy { | ||
| 299 | Default, | ||
| 300 | Filter2x, | ||
| 301 | Filter4x, | ||
| 302 | Filter8x, | ||
| 303 | Filter16x, | ||
| 304 | }; | ||
| 305 | |||
| 297 | struct TSCEntry { | 306 | struct TSCEntry { |
| 298 | union { | 307 | union { |
| 299 | struct { | 308 | struct { |
| @@ -328,7 +337,20 @@ struct TSCEntry { | |||
| 328 | }; | 337 | }; |
| 329 | 338 | ||
| 330 | float GetMaxAnisotropy() const { | 339 | float GetMaxAnisotropy() const { |
| 331 | return static_cast<float>(1U << max_anisotropy); | 340 | switch (static_cast<Anisotropy>(Settings::values.max_anisotropy)) { |
| 341 | case Anisotropy::Default: | ||
| 342 | return static_cast<float>(1U << max_anisotropy); | ||
| 343 | case Anisotropy::Filter2x: | ||
| 344 | return static_cast<float>(2U << max_anisotropy); | ||
| 345 | case Anisotropy::Filter4x: | ||
| 346 | return static_cast<float>(4U << max_anisotropy); | ||
| 347 | case Anisotropy::Filter8x: | ||
| 348 | return static_cast<float>(8U << max_anisotropy); | ||
| 349 | case Anisotropy::Filter16x: | ||
| 350 | return static_cast<float>(16U << max_anisotropy); | ||
| 351 | default: | ||
| 352 | return static_cast<float>(1U << max_anisotropy); | ||
| 353 | } | ||
| 332 | } | 354 | } |
| 333 | 355 | ||
| 334 | float GetMinLod() const { | 356 | float GetMinLod() const { |
diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt index b841e63fa..d34b47b3f 100644 --- a/src/yuzu/CMakeLists.txt +++ b/src/yuzu/CMakeLists.txt | |||
| @@ -42,6 +42,9 @@ add_executable(yuzu | |||
| 42 | configuration/configure_graphics.cpp | 42 | configuration/configure_graphics.cpp |
| 43 | configuration/configure_graphics.h | 43 | configuration/configure_graphics.h |
| 44 | configuration/configure_graphics.ui | 44 | configuration/configure_graphics.ui |
| 45 | configuration/configure_graphics_advanced.cpp | ||
| 46 | configuration/configure_graphics_advanced.h | ||
| 47 | configuration/configure_graphics_advanced.ui | ||
| 45 | configuration/configure_hotkeys.cpp | 48 | configuration/configure_hotkeys.cpp |
| 46 | configuration/configure_hotkeys.h | 49 | configuration/configure_hotkeys.h |
| 47 | configuration/configure_hotkeys.ui | 50 | configuration/configure_hotkeys.ui |
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index d0f574147..c38860628 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -631,6 +631,7 @@ void Config::ReadRendererValues() { | |||
| 631 | Settings::values.resolution_factor = | 631 | Settings::values.resolution_factor = |
| 632 | ReadSetting(QStringLiteral("resolution_factor"), 1.0).toFloat(); | 632 | ReadSetting(QStringLiteral("resolution_factor"), 1.0).toFloat(); |
| 633 | Settings::values.aspect_ratio = ReadSetting(QStringLiteral("aspect_ratio"), 0).toInt(); | 633 | Settings::values.aspect_ratio = ReadSetting(QStringLiteral("aspect_ratio"), 0).toInt(); |
| 634 | Settings::values.max_anisotropy = ReadSetting(QStringLiteral("max_anisotropy"), 0).toInt(); | ||
| 634 | Settings::values.use_frame_limit = | 635 | Settings::values.use_frame_limit = |
| 635 | ReadSetting(QStringLiteral("use_frame_limit"), true).toBool(); | 636 | ReadSetting(QStringLiteral("use_frame_limit"), true).toBool(); |
| 636 | Settings::values.frame_limit = ReadSetting(QStringLiteral("frame_limit"), 100).toInt(); | 637 | Settings::values.frame_limit = ReadSetting(QStringLiteral("frame_limit"), 100).toInt(); |
| @@ -1067,6 +1068,7 @@ void Config::SaveRendererValues() { | |||
| 1067 | WriteSetting(QStringLiteral("resolution_factor"), | 1068 | WriteSetting(QStringLiteral("resolution_factor"), |
| 1068 | static_cast<double>(Settings::values.resolution_factor), 1.0); | 1069 | static_cast<double>(Settings::values.resolution_factor), 1.0); |
| 1069 | WriteSetting(QStringLiteral("aspect_ratio"), Settings::values.aspect_ratio, 0); | 1070 | WriteSetting(QStringLiteral("aspect_ratio"), Settings::values.aspect_ratio, 0); |
| 1071 | WriteSetting(QStringLiteral("max_anisotropy"), Settings::values.max_anisotropy, 0); | ||
| 1070 | WriteSetting(QStringLiteral("use_frame_limit"), Settings::values.use_frame_limit, true); | 1072 | WriteSetting(QStringLiteral("use_frame_limit"), Settings::values.use_frame_limit, true); |
| 1071 | WriteSetting(QStringLiteral("frame_limit"), Settings::values.frame_limit, 100); | 1073 | WriteSetting(QStringLiteral("frame_limit"), Settings::values.frame_limit, 100); |
| 1072 | WriteSetting(QStringLiteral("use_disk_shader_cache"), Settings::values.use_disk_shader_cache, | 1074 | WriteSetting(QStringLiteral("use_disk_shader_cache"), Settings::values.use_disk_shader_cache, |
diff --git a/src/yuzu/configuration/configure.ui b/src/yuzu/configuration/configure.ui index 67b990f1a..9aec1bd09 100644 --- a/src/yuzu/configuration/configure.ui +++ b/src/yuzu/configuration/configure.ui | |||
| @@ -83,6 +83,11 @@ | |||
| 83 | <string>Graphics</string> | 83 | <string>Graphics</string> |
| 84 | </attribute> | 84 | </attribute> |
| 85 | </widget> | 85 | </widget> |
| 86 | <widget class="ConfigureGraphicsAdvanced" name="graphicsAdvancedTab"> | ||
| 87 | <attribute name="title"> | ||
| 88 | <string>GraphicsAdvanced</string> | ||
| 89 | </attribute> | ||
| 90 | </widget> | ||
| 86 | <widget class="ConfigureAudio" name="audioTab"> | 91 | <widget class="ConfigureAudio" name="audioTab"> |
| 87 | <attribute name="title"> | 92 | <attribute name="title"> |
| 88 | <string>Audio</string> | 93 | <string>Audio</string> |
| @@ -160,6 +165,12 @@ | |||
| 160 | <container>1</container> | 165 | <container>1</container> |
| 161 | </customwidget> | 166 | </customwidget> |
| 162 | <customwidget> | 167 | <customwidget> |
| 168 | <class>ConfigureGraphicsAdvanced</class> | ||
| 169 | <extends>QWidget</extends> | ||
| 170 | <header>configuration/configure_graphics_advanced.h</header> | ||
| 171 | <container>1</container> | ||
| 172 | </customwidget> | ||
| 173 | <customwidget> | ||
| 163 | <class>ConfigureWeb</class> | 174 | <class>ConfigureWeb</class> |
| 164 | <extends>QWidget</extends> | 175 | <extends>QWidget</extends> |
| 165 | <header>configuration/configure_web.h</header> | 176 | <header>configuration/configure_web.h</header> |
diff --git a/src/yuzu/configuration/configure_dialog.cpp b/src/yuzu/configuration/configure_dialog.cpp index db3b19352..df4473b46 100644 --- a/src/yuzu/configuration/configure_dialog.cpp +++ b/src/yuzu/configuration/configure_dialog.cpp | |||
| @@ -41,6 +41,7 @@ void ConfigureDialog::ApplyConfiguration() { | |||
| 41 | ui->inputTab->ApplyConfiguration(); | 41 | ui->inputTab->ApplyConfiguration(); |
| 42 | ui->hotkeysTab->ApplyConfiguration(registry); | 42 | ui->hotkeysTab->ApplyConfiguration(registry); |
| 43 | ui->graphicsTab->ApplyConfiguration(); | 43 | ui->graphicsTab->ApplyConfiguration(); |
| 44 | ui->graphicsAdvancedTab->ApplyConfiguration(); | ||
| 44 | ui->audioTab->ApplyConfiguration(); | 45 | ui->audioTab->ApplyConfiguration(); |
| 45 | ui->debugTab->ApplyConfiguration(); | 46 | ui->debugTab->ApplyConfiguration(); |
| 46 | ui->webTab->ApplyConfiguration(); | 47 | ui->webTab->ApplyConfiguration(); |
| @@ -76,7 +77,7 @@ void ConfigureDialog::PopulateSelectionList() { | |||
| 76 | const std::array<std::pair<QString, QList<QWidget*>>, 5> items{ | 77 | const std::array<std::pair<QString, QList<QWidget*>>, 5> items{ |
| 77 | {{tr("General"), {ui->generalTab, ui->webTab, ui->debugTab, ui->uiTab}}, | 78 | {{tr("General"), {ui->generalTab, ui->webTab, ui->debugTab, ui->uiTab}}, |
| 78 | {tr("System"), {ui->systemTab, ui->profileManagerTab, ui->serviceTab, ui->filesystemTab}}, | 79 | {tr("System"), {ui->systemTab, ui->profileManagerTab, ui->serviceTab, ui->filesystemTab}}, |
| 79 | {tr("Graphics"), {ui->graphicsTab}}, | 80 | {tr("Graphics"), {ui->graphicsTab, ui->graphicsAdvancedTab}}, |
| 80 | {tr("Audio"), {ui->audioTab}}, | 81 | {tr("Audio"), {ui->audioTab}}, |
| 81 | {tr("Controls"), {ui->inputTab, ui->hotkeysTab}}}, | 82 | {tr("Controls"), {ui->inputTab, ui->hotkeysTab}}}, |
| 82 | }; | 83 | }; |
| @@ -105,6 +106,7 @@ void ConfigureDialog::UpdateVisibleTabs() { | |||
| 105 | {ui->inputTab, tr("Input")}, | 106 | {ui->inputTab, tr("Input")}, |
| 106 | {ui->hotkeysTab, tr("Hotkeys")}, | 107 | {ui->hotkeysTab, tr("Hotkeys")}, |
| 107 | {ui->graphicsTab, tr("Graphics")}, | 108 | {ui->graphicsTab, tr("Graphics")}, |
| 109 | {ui->graphicsAdvancedTab, tr("Advanced")}, | ||
| 108 | {ui->audioTab, tr("Audio")}, | 110 | {ui->audioTab, tr("Audio")}, |
| 109 | {ui->debugTab, tr("Debug")}, | 111 | {ui->debugTab, tr("Debug")}, |
| 110 | {ui->webTab, tr("Web")}, | 112 | {ui->webTab, tr("Web")}, |
diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index fe64c7d81..a821c7b3c 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp | |||
| @@ -100,13 +100,8 @@ void ConfigureGraphics::SetConfiguration() { | |||
| 100 | ui->aspect_ratio_combobox->setCurrentIndex(Settings::values.aspect_ratio); | 100 | ui->aspect_ratio_combobox->setCurrentIndex(Settings::values.aspect_ratio); |
| 101 | ui->use_disk_shader_cache->setEnabled(runtime_lock); | 101 | ui->use_disk_shader_cache->setEnabled(runtime_lock); |
| 102 | ui->use_disk_shader_cache->setChecked(Settings::values.use_disk_shader_cache); | 102 | ui->use_disk_shader_cache->setChecked(Settings::values.use_disk_shader_cache); |
| 103 | ui->use_accurate_gpu_emulation->setChecked(Settings::values.use_accurate_gpu_emulation); | ||
| 104 | ui->use_asynchronous_gpu_emulation->setEnabled(runtime_lock); | 103 | ui->use_asynchronous_gpu_emulation->setEnabled(runtime_lock); |
| 105 | ui->use_asynchronous_gpu_emulation->setChecked(Settings::values.use_asynchronous_gpu_emulation); | 104 | ui->use_asynchronous_gpu_emulation->setChecked(Settings::values.use_asynchronous_gpu_emulation); |
| 106 | ui->use_vsync->setEnabled(runtime_lock); | ||
| 107 | ui->use_vsync->setChecked(Settings::values.use_vsync); | ||
| 108 | ui->force_30fps_mode->setEnabled(runtime_lock); | ||
| 109 | ui->force_30fps_mode->setChecked(Settings::values.force_30fps_mode); | ||
| 110 | UpdateBackgroundColorButton(QColor::fromRgbF(Settings::values.bg_red, Settings::values.bg_green, | 105 | UpdateBackgroundColorButton(QColor::fromRgbF(Settings::values.bg_red, Settings::values.bg_green, |
| 111 | Settings::values.bg_blue)); | 106 | Settings::values.bg_blue)); |
| 112 | UpdateDeviceComboBox(); | 107 | UpdateDeviceComboBox(); |
| @@ -119,11 +114,8 @@ void ConfigureGraphics::ApplyConfiguration() { | |||
| 119 | ToResolutionFactor(static_cast<Resolution>(ui->resolution_factor_combobox->currentIndex())); | 114 | ToResolutionFactor(static_cast<Resolution>(ui->resolution_factor_combobox->currentIndex())); |
| 120 | Settings::values.aspect_ratio = ui->aspect_ratio_combobox->currentIndex(); | 115 | Settings::values.aspect_ratio = ui->aspect_ratio_combobox->currentIndex(); |
| 121 | Settings::values.use_disk_shader_cache = ui->use_disk_shader_cache->isChecked(); | 116 | Settings::values.use_disk_shader_cache = ui->use_disk_shader_cache->isChecked(); |
| 122 | Settings::values.use_accurate_gpu_emulation = ui->use_accurate_gpu_emulation->isChecked(); | ||
| 123 | Settings::values.use_asynchronous_gpu_emulation = | 117 | Settings::values.use_asynchronous_gpu_emulation = |
| 124 | ui->use_asynchronous_gpu_emulation->isChecked(); | 118 | ui->use_asynchronous_gpu_emulation->isChecked(); |
| 125 | Settings::values.use_vsync = ui->use_vsync->isChecked(); | ||
| 126 | Settings::values.force_30fps_mode = ui->force_30fps_mode->isChecked(); | ||
| 127 | Settings::values.bg_red = static_cast<float>(bg_color.redF()); | 119 | Settings::values.bg_red = static_cast<float>(bg_color.redF()); |
| 128 | Settings::values.bg_green = static_cast<float>(bg_color.greenF()); | 120 | Settings::values.bg_green = static_cast<float>(bg_color.greenF()); |
| 129 | Settings::values.bg_blue = static_cast<float>(bg_color.blueF()); | 121 | Settings::values.bg_blue = static_cast<float>(bg_color.blueF()); |
diff --git a/src/yuzu/configuration/configure_graphics.ui b/src/yuzu/configuration/configure_graphics.ui index 9acc7dd93..c816d6108 100644 --- a/src/yuzu/configuration/configure_graphics.ui +++ b/src/yuzu/configuration/configure_graphics.ui | |||
| @@ -85,30 +85,6 @@ | |||
| 85 | </widget> | 85 | </widget> |
| 86 | </item> | 86 | </item> |
| 87 | <item> | 87 | <item> |
| 88 | <widget class="QCheckBox" name="use_vsync"> | ||
| 89 | <property name="toolTip"> | ||
| 90 | <string>VSync prevents the screen from tearing, but some graphics cards have lower performance with VSync enabled. Keep it enabled if you don't notice a performance difference.</string> | ||
| 91 | </property> | ||
| 92 | <property name="text"> | ||
| 93 | <string>Use VSync (OpenGL only)</string> | ||
| 94 | </property> | ||
| 95 | </widget> | ||
| 96 | </item> | ||
| 97 | <item> | ||
| 98 | <widget class="QCheckBox" name="use_accurate_gpu_emulation"> | ||
| 99 | <property name="text"> | ||
| 100 | <string>Use accurate GPU emulation (slow)</string> | ||
| 101 | </property> | ||
| 102 | </widget> | ||
| 103 | </item> | ||
| 104 | <item> | ||
| 105 | <widget class="QCheckBox" name="force_30fps_mode"> | ||
| 106 | <property name="text"> | ||
| 107 | <string>Force 30 FPS mode</string> | ||
| 108 | </property> | ||
| 109 | </widget> | ||
| 110 | </item> | ||
| 111 | <item> | ||
| 112 | <layout class="QHBoxLayout" name="horizontalLayout_2"> | 88 | <layout class="QHBoxLayout" name="horizontalLayout_2"> |
| 113 | <item> | 89 | <item> |
| 114 | <widget class="QLabel" name="label"> | 90 | <widget class="QLabel" name="label"> |
diff --git a/src/yuzu/configuration/configure_graphics_advanced.cpp b/src/yuzu/configuration/configure_graphics_advanced.cpp new file mode 100644 index 000000000..b9f429f84 --- /dev/null +++ b/src/yuzu/configuration/configure_graphics_advanced.cpp | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | // Copyright 2020 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "core/core.h" | ||
| 6 | #include "core/settings.h" | ||
| 7 | #include "ui_configure_graphics_advanced.h" | ||
| 8 | #include "yuzu/configuration/configure_graphics_advanced.h" | ||
| 9 | |||
| 10 | ConfigureGraphicsAdvanced::ConfigureGraphicsAdvanced(QWidget* parent) | ||
| 11 | : QWidget(parent), ui(new Ui::ConfigureGraphicsAdvanced) { | ||
| 12 | |||
| 13 | ui->setupUi(this); | ||
| 14 | |||
| 15 | SetConfiguration(); | ||
| 16 | } | ||
| 17 | |||
| 18 | ConfigureGraphicsAdvanced::~ConfigureGraphicsAdvanced() = default; | ||
| 19 | |||
| 20 | void ConfigureGraphicsAdvanced::SetConfiguration() { | ||
| 21 | const bool runtime_lock = !Core::System::GetInstance().IsPoweredOn(); | ||
| 22 | ui->use_accurate_gpu_emulation->setChecked(Settings::values.use_accurate_gpu_emulation); | ||
| 23 | ui->use_vsync->setEnabled(runtime_lock); | ||
| 24 | ui->use_vsync->setChecked(Settings::values.use_vsync); | ||
| 25 | ui->force_30fps_mode->setEnabled(runtime_lock); | ||
| 26 | ui->force_30fps_mode->setChecked(Settings::values.force_30fps_mode); | ||
| 27 | ui->anisotropic_filtering_combobox->setEnabled(runtime_lock); | ||
| 28 | ui->anisotropic_filtering_combobox->setCurrentIndex(Settings::values.max_anisotropy); | ||
| 29 | } | ||
| 30 | |||
| 31 | void ConfigureGraphicsAdvanced::ApplyConfiguration() { | ||
| 32 | Settings::values.use_accurate_gpu_emulation = ui->use_accurate_gpu_emulation->isChecked(); | ||
| 33 | Settings::values.use_vsync = ui->use_vsync->isChecked(); | ||
| 34 | Settings::values.force_30fps_mode = ui->force_30fps_mode->isChecked(); | ||
| 35 | Settings::values.max_anisotropy = ui->anisotropic_filtering_combobox->currentIndex(); | ||
| 36 | } | ||
| 37 | |||
| 38 | void ConfigureGraphicsAdvanced::changeEvent(QEvent* event) { | ||
| 39 | if (event->type() == QEvent::LanguageChange) { | ||
| 40 | RetranslateUI(); | ||
| 41 | } | ||
| 42 | |||
| 43 | QWidget::changeEvent(event); | ||
| 44 | } | ||
| 45 | |||
| 46 | void ConfigureGraphicsAdvanced::RetranslateUI() { | ||
| 47 | ui->retranslateUi(this); | ||
| 48 | } | ||
diff --git a/src/yuzu/configuration/configure_graphics_advanced.h b/src/yuzu/configuration/configure_graphics_advanced.h new file mode 100644 index 000000000..bbc9d4355 --- /dev/null +++ b/src/yuzu/configuration/configure_graphics_advanced.h | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | // Copyright 2020 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <memory> | ||
| 8 | #include <QWidget> | ||
| 9 | |||
| 10 | namespace Ui { | ||
| 11 | class ConfigureGraphicsAdvanced; | ||
| 12 | } | ||
| 13 | |||
| 14 | class ConfigureGraphicsAdvanced : public QWidget { | ||
| 15 | Q_OBJECT | ||
| 16 | |||
| 17 | public: | ||
| 18 | explicit ConfigureGraphicsAdvanced(QWidget* parent = nullptr); | ||
| 19 | ~ConfigureGraphicsAdvanced() override; | ||
| 20 | |||
| 21 | void ApplyConfiguration(); | ||
| 22 | |||
| 23 | private: | ||
| 24 | void changeEvent(QEvent* event) override; | ||
| 25 | void RetranslateUI(); | ||
| 26 | |||
| 27 | void SetConfiguration(); | ||
| 28 | |||
| 29 | std::unique_ptr<Ui::ConfigureGraphicsAdvanced> ui; | ||
| 30 | }; | ||
diff --git a/src/yuzu/configuration/configure_graphics_advanced.ui b/src/yuzu/configuration/configure_graphics_advanced.ui new file mode 100644 index 000000000..42eec278e --- /dev/null +++ b/src/yuzu/configuration/configure_graphics_advanced.ui | |||
| @@ -0,0 +1,111 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | <ui version="4.0"> | ||
| 3 | <class>ConfigureGraphicsAdvanced</class> | ||
| 4 | <widget class="QWidget" name="ConfigureGraphicsAdvanced"> | ||
| 5 | <property name="geometry"> | ||
| 6 | <rect> | ||
| 7 | <x>0</x> | ||
| 8 | <y>0</y> | ||
| 9 | <width>400</width> | ||
| 10 | <height>321</height> | ||
| 11 | </rect> | ||
| 12 | </property> | ||
| 13 | <property name="windowTitle"> | ||
| 14 | <string>Form</string> | ||
| 15 | </property> | ||
| 16 | <layout class="QVBoxLayout" name="verticalLayout_1"> | ||
| 17 | <item> | ||
| 18 | <layout class="QVBoxLayout" name="verticalLayout_2"> | ||
| 19 | <item> | ||
| 20 | <widget class="QGroupBox" name="groupBox_1"> | ||
| 21 | <property name="title"> | ||
| 22 | <string>Advanced Graphics Settings</string> | ||
| 23 | </property> | ||
| 24 | <layout class="QVBoxLayout" name="verticalLayout_3"> | ||
| 25 | <item> | ||
| 26 | <widget class="QCheckBox" name="use_accurate_gpu_emulation"> | ||
| 27 | <property name="text"> | ||
| 28 | <string>Use accurate GPU emulation (slow)</string> | ||
| 29 | </property> | ||
| 30 | </widget> | ||
| 31 | </item> | ||
| 32 | <item> | ||
| 33 | <widget class="QCheckBox" name="use_vsync"> | ||
| 34 | <property name="toolTip"> | ||
| 35 | <string>VSync prevents the screen from tearing, but some graphics cards have lower performance with VSync enabled. Keep it enabled if you don't notice a performance difference.</string> | ||
| 36 | </property> | ||
| 37 | <property name="text"> | ||
| 38 | <string>Use VSync (OpenGL only)</string> | ||
| 39 | </property> | ||
| 40 | </widget> | ||
| 41 | </item> | ||
| 42 | <item> | ||
| 43 | <widget class="QCheckBox" name="force_30fps_mode"> | ||
| 44 | <property name="text"> | ||
| 45 | <string>Force 30 FPS mode</string> | ||
| 46 | </property> | ||
| 47 | </widget> | ||
| 48 | </item> | ||
| 49 | <item> | ||
| 50 | <layout class="QHBoxLayout" name="horizontalLayout_1"> | ||
| 51 | <item> | ||
| 52 | <widget class="QLabel" name="af_label"> | ||
| 53 | <property name="text"> | ||
| 54 | <string>Anisotropic Filtering:</string> | ||
| 55 | </property> | ||
| 56 | </widget> | ||
| 57 | </item> | ||
| 58 | <item> | ||
| 59 | <widget class="QComboBox" name="anisotropic_filtering_combobox"> | ||
| 60 | <item> | ||
| 61 | <property name="text"> | ||
| 62 | <string>Default</string> | ||
| 63 | </property> | ||
| 64 | </item> | ||
| 65 | <item> | ||
| 66 | <property name="text"> | ||
| 67 | <string>2x</string> | ||
| 68 | </property> | ||
| 69 | </item> | ||
| 70 | <item> | ||
| 71 | <property name="text"> | ||
| 72 | <string>4x</string> | ||
| 73 | </property> | ||
| 74 | </item> | ||
| 75 | <item> | ||
| 76 | <property name="text"> | ||
| 77 | <string>8x</string> | ||
| 78 | </property> | ||
| 79 | </item> | ||
| 80 | <item> | ||
| 81 | <property name="text"> | ||
| 82 | <string>16x</string> | ||
| 83 | </property> | ||
| 84 | </item> | ||
| 85 | </widget> | ||
| 86 | </item> | ||
| 87 | </layout> | ||
| 88 | </item> | ||
| 89 | </layout> | ||
| 90 | </widget> | ||
| 91 | </item> | ||
| 92 | </layout> | ||
| 93 | </item> | ||
| 94 | <item> | ||
| 95 | <spacer name="verticalSpacer"> | ||
| 96 | <property name="orientation"> | ||
| 97 | <enum>Qt::Vertical</enum> | ||
| 98 | </property> | ||
| 99 | <property name="sizeHint" stdset="0"> | ||
| 100 | <size> | ||
| 101 | <width>20</width> | ||
| 102 | <height>40</height> | ||
| 103 | </size> | ||
| 104 | </property> | ||
| 105 | </spacer> | ||
| 106 | </item> | ||
| 107 | </layout> | ||
| 108 | </widget> | ||
| 109 | <resources/> | ||
| 110 | <connections/> | ||
| 111 | </ui> | ||
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index b77c12baf..907abaa51 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp | |||
| @@ -381,6 +381,8 @@ void Config::ReadValues() { | |||
| 381 | static_cast<float>(sdl2_config->GetReal("Renderer", "resolution_factor", 1.0)); | 381 | static_cast<float>(sdl2_config->GetReal("Renderer", "resolution_factor", 1.0)); |
| 382 | Settings::values.aspect_ratio = | 382 | Settings::values.aspect_ratio = |
| 383 | static_cast<int>(sdl2_config->GetInteger("Renderer", "aspect_ratio", 0)); | 383 | static_cast<int>(sdl2_config->GetInteger("Renderer", "aspect_ratio", 0)); |
| 384 | Settings::values.max_anisotropy = | ||
| 385 | static_cast<int>(sdl2_config->GetInteger("Renderer", "max_anisotropy", 0)); | ||
| 384 | Settings::values.use_frame_limit = sdl2_config->GetBoolean("Renderer", "use_frame_limit", true); | 386 | Settings::values.use_frame_limit = sdl2_config->GetBoolean("Renderer", "use_frame_limit", true); |
| 385 | Settings::values.frame_limit = | 387 | Settings::values.frame_limit = |
| 386 | static_cast<u16>(sdl2_config->GetInteger("Renderer", "frame_limit", 100)); | 388 | static_cast<u16>(sdl2_config->GetInteger("Renderer", "frame_limit", 100)); |
diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h index 085ffbc81..d63d7a58e 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h | |||
| @@ -126,6 +126,10 @@ resolution_factor = | |||
| 126 | # 0: Default (16:9), 1: Force 4:3, 2: Force 21:9, 3: Stretch to Window | 126 | # 0: Default (16:9), 1: Force 4:3, 2: Force 21:9, 3: Stretch to Window |
| 127 | aspect_ratio = | 127 | aspect_ratio = |
| 128 | 128 | ||
| 129 | # Anisotropic filtering | ||
| 130 | # 0: Default, 1: 2x, 2: 4x, 3: 8x, 4: 16x | ||
| 131 | max_anisotropy = | ||
| 132 | |||
| 129 | # Whether to enable V-Sync (caps the framerate at 60FPS) or not. | 133 | # Whether to enable V-Sync (caps the framerate at 60FPS) or not. |
| 130 | # 0 (default): Off, 1: On | 134 | # 0 (default): Off, 1: On |
| 131 | use_vsync = | 135 | use_vsync = |
diff --git a/src/yuzu_tester/config.cpp b/src/yuzu_tester/config.cpp index 0ac93b62a..ee2591c8f 100644 --- a/src/yuzu_tester/config.cpp +++ b/src/yuzu_tester/config.cpp | |||
| @@ -120,6 +120,8 @@ void Config::ReadValues() { | |||
| 120 | static_cast<float>(sdl2_config->GetReal("Renderer", "resolution_factor", 1.0)); | 120 | static_cast<float>(sdl2_config->GetReal("Renderer", "resolution_factor", 1.0)); |
| 121 | Settings::values.aspect_ratio = | 121 | Settings::values.aspect_ratio = |
| 122 | static_cast<int>(sdl2_config->GetInteger("Renderer", "aspect_ratio", 0)); | 122 | static_cast<int>(sdl2_config->GetInteger("Renderer", "aspect_ratio", 0)); |
| 123 | Settings::values.max_anisotropy = | ||
| 124 | static_cast<int>(sdl2_config->GetInteger("Renderer", "max_anisotropy", 0)); | ||
| 123 | Settings::values.use_frame_limit = false; | 125 | Settings::values.use_frame_limit = false; |
| 124 | Settings::values.frame_limit = 100; | 126 | Settings::values.frame_limit = 100; |
| 125 | Settings::values.use_disk_shader_cache = | 127 | Settings::values.use_disk_shader_cache = |
diff --git a/src/yuzu_tester/default_ini.h b/src/yuzu_tester/default_ini.h index 8d93f7b88..ca203b64d 100644 --- a/src/yuzu_tester/default_ini.h +++ b/src/yuzu_tester/default_ini.h | |||
| @@ -30,6 +30,10 @@ resolution_factor = | |||
| 30 | # 0: Default (16:9), 1: Force 4:3, 2: Force 21:9, 3: Stretch to Window | 30 | # 0: Default (16:9), 1: Force 4:3, 2: Force 21:9, 3: Stretch to Window |
| 31 | aspect_ratio = | 31 | aspect_ratio = |
| 32 | 32 | ||
| 33 | # Anisotropic filtering | ||
| 34 | # 0: Default, 1: 2x, 2: 4x, 3: 8x, 4: 16x | ||
| 35 | max_anisotropy = | ||
| 36 | |||
| 33 | # Whether to enable V-Sync (caps the framerate at 60FPS) or not. | 37 | # Whether to enable V-Sync (caps the framerate at 60FPS) or not. |
| 34 | # 0 (default): Off, 1: On | 38 | # 0 (default): Off, 1: On |
| 35 | use_vsync = | 39 | use_vsync = |