diff --git a/src/common/config.cpp b/src/common/config.cpp index 9e999774da2..407c14802e6 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -70,6 +70,7 @@ static bool separateupdatefolder = false; static bool compatibilityData = false; static bool checkCompatibilityOnStartup = false; static std::string trophyKey; +static std::string ppFilter; // Gui static bool load_game_size = true; @@ -239,6 +240,10 @@ u32 vblankDiv() { return vblankDivider; } +std::string getPostProcessingFilter() { + return ppFilter; +} + bool vkValidationEnabled() { return vkValidation; } @@ -327,6 +332,9 @@ void setVblankDiv(u32 value) { vblankDivider = value; } +void setPostProcessingFilter(const std::string& type) { + ppFilter = type; +} void setIsFullscreen(bool enable) { isFullscreen = enable; } @@ -636,6 +644,7 @@ void load(const std::filesystem::path& path) { screenWidth = toml::find_or(gpu, "screenWidth", screenWidth); screenHeight = toml::find_or(gpu, "screenHeight", screenHeight); + ppFilter = toml::find_or(gpu, "ppFilter", "linear"); isNullGpu = toml::find_or(gpu, "nullGpu", false); shouldCopyGPUBuffers = toml::find_or(gpu, "copyGPUBuffers", false); shouldDumpShaders = toml::find_or(gpu, "dumpShaders", false); @@ -749,6 +758,7 @@ void save(const std::filesystem::path& path) { data["Input"]["isMotionControlsEnabled"] = isMotionControlsEnabled; data["GPU"]["screenWidth"] = screenWidth; data["GPU"]["screenHeight"] = screenHeight; + data["GPU"]["ppFilter"] = ppFilter; data["GPU"]["nullGpu"] = isNullGpu; data["GPU"]["copyGPUBuffers"] = shouldCopyGPUBuffers; data["GPU"]["dumpShaders"] = shouldDumpShaders; diff --git a/src/common/config.h b/src/common/config.h index 61c11b84254..5f924e07be6 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -45,6 +45,7 @@ bool getIsMotionControlsEnabled(); u32 getScreenWidth(); u32 getScreenHeight(); s32 getGpuId(); +std::string getPostProcessingFilter(); bool debugDump(); bool collectShadersForDebug(); @@ -65,6 +66,7 @@ void setNullGpu(bool enable); void setCopyGPUCmdBuffers(bool enable); void setDumpShaders(bool enable); void setVblankDiv(u32 value); +void setPostProcessingFilter(const std::string& type); void setGpuId(s32 selectedGpuId); void setScreenWidth(u32 width); void setScreenHeight(u32 height); diff --git a/src/qt_gui/settings_dialog.cpp b/src/qt_gui/settings_dialog.cpp index aab57e1831d..99812d87e9f 100644 --- a/src/qt_gui/settings_dialog.cpp +++ b/src/qt_gui/settings_dialog.cpp @@ -91,6 +91,9 @@ SettingsDialog::SettingsDialog(std::span physical_devices, ui->backButtonBehaviorComboBox->addItem(tr("Touchpad Right"), "right"); ui->backButtonBehaviorComboBox->addItem(tr("None"), "none"); + ui->ppFilterComboBox->addItem(tr("Linear"), "linear"); + ui->ppFilterComboBox->addItem(tr("Nearest"), "nearest"); + InitializeEmulatorLanguages(); LoadValuesFromConfig(); @@ -302,6 +305,11 @@ void SettingsDialog::LoadValuesFromConfig() { ui->widthSpinBox->setValue(toml::find_or(data, "GPU", "screenWidth", 1280)); ui->heightSpinBox->setValue(toml::find_or(data, "GPU", "screenHeight", 720)); ui->vblankSpinBox->setValue(toml::find_or(data, "GPU", "vblankDivider", 1)); + if (const auto i = ui->ppFilterComboBox->findData( + QString::fromStdString(toml::find_or(data, "GPU", "ppFilter", "linear"))); + i != -1) { + ui->ppFilterComboBox->setCurrentIndex(i); + } ui->dumpShadersCheckBox->setChecked(toml::find_or(data, "GPU", "dumpShaders", false)); ui->nullGpuCheckBox->setChecked(toml::find_or(data, "GPU", "nullGpu", false)); ui->playBGMCheckBox->setChecked(toml::find_or(data, "General", "playBGM", false)); @@ -568,6 +576,7 @@ void SettingsDialog::UpdateSettings() { Config::setScreenWidth(ui->widthSpinBox->value()); Config::setScreenHeight(ui->heightSpinBox->value()); Config::setVblankDiv(ui->vblankSpinBox->value()); + Config::setPostProcessingFilter(ui->ppFilterComboBox->currentData().toString().toStdString()); Config::setDumpShaders(ui->dumpShadersCheckBox->isChecked()); Config::setNullGpu(ui->nullGpuCheckBox->isChecked()); Config::setSeparateUpdateEnabled(ui->separateUpdatesCheckBox->isChecked()); diff --git a/src/qt_gui/settings_dialog.ui b/src/qt_gui/settings_dialog.ui index 184f16c0fe8..4455eda7dd3 100644 --- a/src/qt_gui/settings_dialog.ui +++ b/src/qt_gui/settings_dialog.ui @@ -983,6 +983,18 @@ 0 + + + + Post-Processing Filter + + + + + + + + @@ -1465,4 +1477,4 @@ - + \ No newline at end of file