diff options
author | FernandoS27 <fsahmkow27@gmail.com> | 2021-10-21 02:05:16 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-11-16 22:11:32 +0100 |
commit | 2eff80b47f578b346bb80c5afa2271859cd7943b (patch) | |
tree | 8846519d75e038e4677e08999a0e5a2cdbcf5560 | |
parent | VideoCore: Add gaussian filtering. (diff) | |
download | yuzu-2eff80b47f578b346bb80c5afa2271859cd7943b.tar yuzu-2eff80b47f578b346bb80c5afa2271859cd7943b.tar.gz yuzu-2eff80b47f578b346bb80c5afa2271859cd7943b.tar.bz2 yuzu-2eff80b47f578b346bb80c5afa2271859cd7943b.tar.lz yuzu-2eff80b47f578b346bb80c5afa2271859cd7943b.tar.xz yuzu-2eff80b47f578b346bb80c5afa2271859cd7943b.tar.zst yuzu-2eff80b47f578b346bb80c5afa2271859cd7943b.zip |
-rw-r--r-- | src/common/settings.h | 1 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.cpp | 1 | ||||
-rw-r--r-- | src/yuzu/configuration/configure_graphics.ui | 2 | ||||
-rw-r--r-- | src/yuzu/main.cpp | 56 | ||||
-rw-r--r-- | src/yuzu/main.h | 2 |
5 files changed, 61 insertions, 1 deletions
diff --git a/src/common/settings.h b/src/common/settings.h index 830030efd..e926a3268 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -70,6 +70,7 @@ enum class ScalingFilter : u32 { Gaussian = 3, ScaleForce = 4, Fsr = 5, + LastFilter = Fsr, }; struct ResolutionScalingInfo { diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 6132b3c49..227697c4f 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -24,6 +24,7 @@ #include "video_core/host_shaders/opengl_present_frag.h" #include "video_core/host_shaders/opengl_present_vert.h" #include "video_core/host_shaders/present_bicubic_frag.h" +#include "video_core/host_shaders/present_gaussian_frag.h" #include "video_core/host_shaders/present_scaleforce_frag.h" #include "video_core/renderer_opengl/gl_rasterizer.h" #include "video_core/renderer_opengl/gl_shader_manager.h" diff --git a/src/yuzu/configuration/configure_graphics.ui b/src/yuzu/configuration/configure_graphics.ui index 848ee2d08..7cfb2860d 100644 --- a/src/yuzu/configuration/configure_graphics.ui +++ b/src/yuzu/configuration/configure_graphics.ui @@ -429,7 +429,7 @@ </item> <item> <property name="text"> - <string>FidelityFX Super Resolution [Vulkan Only]</string> + <string>AMD's FidelityFX™️ Super Resolution [Vulkan Only]</string> </property> </item> </widget> diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 3cb146982..379bd0b17 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -774,6 +774,34 @@ void GMainWindow::InitializeWidgets() { tas_label->setFocusPolicy(Qt::NoFocus); statusBar()->insertPermanentWidget(0, tas_label); + // Setup Filter button + filter_status_button = new QPushButton(); + filter_status_button->setObjectName(QStringLiteral("TogglableStatusBarButton")); + filter_status_button->setFocusPolicy(Qt::NoFocus); + connect(filter_status_button, &QPushButton::clicked, [&] { + auto filter = Settings::values.scaling_filter.GetValue(); + if (filter == Settings::ScalingFilter::LastFilter) { + filter = Settings::ScalingFilter::NearestNeighbor; + } else { + filter = static_cast<Settings::ScalingFilter>(static_cast<u32>(filter) + 1); + } + if (Settings::values.renderer_backend.GetValue() == Settings::RendererBackend::OpenGL && + filter == Settings::ScalingFilter::Fsr) { + filter = Settings::ScalingFilter::NearestNeighbor; + } + Settings::values.scaling_filter.SetValue(filter); + filter_status_button->setChecked(true); + UpdateFilterText(); + }); + auto filter = Settings::values.scaling_filter.GetValue(); + if (Settings::values.renderer_backend.GetValue() == Settings::RendererBackend::OpenGL && + filter == Settings::ScalingFilter::Fsr) { + Settings::values.scaling_filter.SetValue(Settings::ScalingFilter::NearestNeighbor); + } + UpdateFilterText(); + filter_status_button->setCheckable(true); + statusBar()->insertPermanentWidget(0, filter_status_button); + // Setup Dock button dock_status_button = new QPushButton(); dock_status_button->setObjectName(QStringLiteral("TogglableStatusBarButton")); @@ -3033,11 +3061,39 @@ void GMainWindow::UpdateGPUAccuracyButton() { } } +void GMainWindow::UpdateFilterText() { + const auto filter = Settings::values.scaling_filter.GetValue(); + switch (filter) { + case Settings::ScalingFilter::NearestNeighbor: + filter_status_button->setText(tr("NEAREST")); + break; + case Settings::ScalingFilter::Bilinear: + filter_status_button->setText(tr("BILINEAR")); + break; + case Settings::ScalingFilter::Bicubic: + filter_status_button->setText(tr("BICUBIC")); + break; + case Settings::ScalingFilter::Gaussian: + filter_status_button->setText(tr("GAUSSIAN")); + break; + case Settings::ScalingFilter::ScaleForce: + filter_status_button->setText(tr("SCALEFORCE")); + break; + case Settings::ScalingFilter::Fsr: + filter_status_button->setText(tr("AMD'S FIDELITYFX SR")); + break; + default: + filter_status_button->setText(tr("BILINEAR")); + break; + } +} + void GMainWindow::UpdateStatusButtons() { dock_status_button->setChecked(Settings::values.use_docked_mode.GetValue()); renderer_status_button->setChecked(Settings::values.renderer_backend.GetValue() == Settings::RendererBackend::Vulkan); UpdateGPUAccuracyButton(); + UpdateFilterText(); } void GMainWindow::UpdateUISettings() { diff --git a/src/yuzu/main.h b/src/yuzu/main.h index beb4f2984..d4d2f3d58 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -302,6 +302,7 @@ private: void MigrateConfigFiles(); void UpdateWindowTitle(std::string_view title_name = {}, std::string_view title_version = {}, std::string_view gpu_vendor = {}); + void UpdateFilterText(); void UpdateStatusBar(); void UpdateGPUAccuracyButton(); void UpdateStatusButtons(); @@ -336,6 +337,7 @@ private: QPushButton* gpu_accuracy_button = nullptr; QPushButton* renderer_status_button = nullptr; QPushButton* dock_status_button = nullptr; + QPushButton* filter_status_button = nullptr; QTimer status_bar_update_timer; std::unique_ptr<Config> config; |