diff options
| author | 2022-11-26 00:51:08 -0300 | |
|---|---|---|
| committer | 2022-11-26 00:51:08 -0300 | |
| commit | c8d84cb6cb6472d7c93413f30a0d3f94ef592181 (patch) | |
| tree | 97ffe9af41e388a87ca07442a3098deb62dc3856 /src | |
| parent | FSR Sharpening Slider part 1 - only a global slider (diff) | |
| parent | configure_graphics: Implement custom FSR Sharpening setting (diff) | |
| download | yuzu-c8d84cb6cb6472d7c93413f30a0d3f94ef592181.tar.gz yuzu-c8d84cb6cb6472d7c93413f30a0d3f94ef592181.tar.xz yuzu-c8d84cb6cb6472d7c93413f30a0d3f94ef592181.zip | |
Merge pull request #1 from lat9nq/fsrSlider
configure_graphics: Implement custom setting for FSR Sharpening
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/settings.cpp | 1 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics.cpp | 26 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics.ui | 163 |
3 files changed, 129 insertions, 61 deletions
diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 926268ffc..d8ffe34c3 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp | |||
| @@ -182,6 +182,7 @@ void RestoreGlobalState(bool is_powered_on) { | |||
| 182 | values.cpuopt_unsafe_ignore_global_monitor.SetGlobal(true); | 182 | values.cpuopt_unsafe_ignore_global_monitor.SetGlobal(true); |
| 183 | 183 | ||
| 184 | // Renderer | 184 | // Renderer |
| 185 | values.fsr_sharpening_slider.SetGlobal(true); | ||
| 185 | values.renderer_backend.SetGlobal(true); | 186 | values.renderer_backend.SetGlobal(true); |
| 186 | values.vulkan_device.SetGlobal(true); | 187 | values.vulkan_device.SetGlobal(true); |
| 187 | values.aspect_ratio.SetGlobal(true); | 188 | values.aspect_ratio.SetGlobal(true); |
diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index 3a40872ab..f1385e972 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp | |||
| @@ -66,6 +66,8 @@ ConfigureGraphics::ConfigureGraphics(const Core::System& system_, QWidget* paren | |||
| 66 | 66 | ||
| 67 | connect(ui->fsr_sharpening_slider, &QSlider::valueChanged, this, | 67 | connect(ui->fsr_sharpening_slider, &QSlider::valueChanged, this, |
| 68 | &ConfigureGraphics::SetFSRIndicatorText); | 68 | &ConfigureGraphics::SetFSRIndicatorText); |
| 69 | ui->fsr_sharpening_combobox->setVisible(!Settings::IsConfiguringGlobal()); | ||
| 70 | ui->fsr_sharpening_label->setVisible(Settings::IsConfiguringGlobal()); | ||
| 69 | } | 71 | } |
| 70 | 72 | ||
| 71 | void ConfigureGraphics::UpdateDeviceSelection(int device) { | 73 | void ConfigureGraphics::UpdateDeviceSelection(int device) { |
| @@ -151,6 +153,15 @@ void ConfigureGraphics::SetConfiguration() { | |||
| 151 | ConfigurationShared::SetHighlight(ui->anti_aliasing_label, | 153 | ConfigurationShared::SetHighlight(ui->anti_aliasing_label, |
| 152 | !Settings::values.anti_aliasing.UsingGlobal()); | 154 | !Settings::values.anti_aliasing.UsingGlobal()); |
| 153 | 155 | ||
| 156 | ui->fsr_sharpening_combobox->setCurrentIndex( | ||
| 157 | Settings::values.fsr_sharpening_slider.UsingGlobal() ? 0 : 1); | ||
| 158 | ui->fsr_sharpening_slider->setEnabled( | ||
| 159 | !Settings::values.fsr_sharpening_slider.UsingGlobal()); | ||
| 160 | ui->fsr_sharpening_value->setEnabled(!Settings::values.fsr_sharpening_slider.UsingGlobal()); | ||
| 161 | ConfigurationShared::SetHighlight(ui->fsr_sharpening_layout, | ||
| 162 | !Settings::values.fsr_sharpening_slider.UsingGlobal()); | ||
| 163 | ui->fsr_sharpening_slider->setValue(Settings::values.fsr_sharpening_slider.GetValue()); | ||
| 164 | |||
| 154 | ui->bg_combobox->setCurrentIndex(Settings::values.bg_red.UsingGlobal() ? 0 : 1); | 165 | ui->bg_combobox->setCurrentIndex(Settings::values.bg_red.UsingGlobal() ? 0 : 1); |
| 155 | ui->bg_button->setEnabled(!Settings::values.bg_red.UsingGlobal()); | 166 | ui->bg_button->setEnabled(!Settings::values.bg_red.UsingGlobal()); |
| 156 | ConfigurationShared::SetHighlight(ui->bg_layout, !Settings::values.bg_red.UsingGlobal()); | 167 | ConfigurationShared::SetHighlight(ui->bg_layout, !Settings::values.bg_red.UsingGlobal()); |
| @@ -280,6 +291,13 @@ void ConfigureGraphics::ApplyConfiguration() { | |||
| 280 | Settings::values.bg_green.SetValue(static_cast<u8>(bg_color.green())); | 291 | Settings::values.bg_green.SetValue(static_cast<u8>(bg_color.green())); |
| 281 | Settings::values.bg_blue.SetValue(static_cast<u8>(bg_color.blue())); | 292 | Settings::values.bg_blue.SetValue(static_cast<u8>(bg_color.blue())); |
| 282 | } | 293 | } |
| 294 | |||
| 295 | if (ui->fsr_sharpening_combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { | ||
| 296 | Settings::values.fsr_sharpening_slider.SetGlobal(true); | ||
| 297 | } else { | ||
| 298 | Settings::values.fsr_sharpening_slider.SetGlobal(false); | ||
| 299 | Settings::values.fsr_sharpening_slider.SetValue(ui->fsr_sharpening_slider->value()); | ||
| 300 | } | ||
| 283 | } | 301 | } |
| 284 | } | 302 | } |
| 285 | 303 | ||
| @@ -399,6 +417,7 @@ void ConfigureGraphics::SetupPerGameUI() { | |||
| 399 | ui->accelerate_astc->setEnabled(Settings::values.accelerate_astc.UsingGlobal()); | 417 | ui->accelerate_astc->setEnabled(Settings::values.accelerate_astc.UsingGlobal()); |
| 400 | ui->use_disk_shader_cache->setEnabled(Settings::values.use_disk_shader_cache.UsingGlobal()); | 418 | ui->use_disk_shader_cache->setEnabled(Settings::values.use_disk_shader_cache.UsingGlobal()); |
| 401 | ui->bg_button->setEnabled(Settings::values.bg_red.UsingGlobal()); | 419 | ui->bg_button->setEnabled(Settings::values.bg_red.UsingGlobal()); |
| 420 | ui->fsr_slider_layout->setEnabled(Settings::values.fsr_sharpening_slider.UsingGlobal()); | ||
| 402 | 421 | ||
| 403 | return; | 422 | return; |
| 404 | } | 423 | } |
| @@ -408,6 +427,13 @@ void ConfigureGraphics::SetupPerGameUI() { | |||
| 408 | ConfigurationShared::SetHighlight(ui->bg_layout, index == 1); | 427 | ConfigurationShared::SetHighlight(ui->bg_layout, index == 1); |
| 409 | }); | 428 | }); |
| 410 | 429 | ||
| 430 | connect(ui->fsr_sharpening_combobox, qOverload<int>(&QComboBox::activated), this, | ||
| 431 | [this](int index) { | ||
| 432 | ui->fsr_sharpening_slider->setEnabled(index == 1); | ||
| 433 | ui->fsr_sharpening_value->setEnabled(index == 1); | ||
| 434 | ConfigurationShared::SetHighlight(ui->fsr_sharpening_layout, index == 1); | ||
| 435 | }); | ||
| 436 | |||
| 411 | ConfigurationShared::SetColoredTristate( | 437 | ConfigurationShared::SetColoredTristate( |
| 412 | ui->use_disk_shader_cache, Settings::values.use_disk_shader_cache, use_disk_shader_cache); | 438 | ui->use_disk_shader_cache, Settings::values.use_disk_shader_cache, use_disk_shader_cache); |
| 413 | ConfigurationShared::SetColoredTristate(ui->accelerate_astc, Settings::values.accelerate_astc, | 439 | ConfigurationShared::SetColoredTristate(ui->accelerate_astc, Settings::values.accelerate_astc, |
diff --git a/src/yuzu/configuration/configure_graphics.ui b/src/yuzu/configuration/configure_graphics.ui index de8b2f44e..1f8c84394 100644 --- a/src/yuzu/configuration/configure_graphics.ui +++ b/src/yuzu/configuration/configure_graphics.ui | |||
| @@ -517,73 +517,114 @@ | |||
| 517 | <property name="bottomMargin"> | 517 | <property name="bottomMargin"> |
| 518 | <number>0</number> | 518 | <number>0</number> |
| 519 | </property> | 519 | </property> |
| 520 | <item alignment="Qt::AlignLeft"> | ||
| 521 | <widget class="QLabel" name="fsr_sharpening_label"> | ||
| 522 | <property name="sizePolicy"> | ||
| 523 | <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> | ||
| 524 | <horstretch>0</horstretch> | ||
| 525 | <verstretch>0</verstretch> | ||
| 526 | </sizepolicy> | ||
| 527 | </property> | ||
| 528 | <property name="text"> | ||
| 529 | <string>FSR Sharpening:</string> | ||
| 530 | </property> | ||
| 531 | </widget> | ||
| 532 | </item> | ||
| 533 | <item> | 520 | <item> |
| 534 | <widget class="QSlider" name="fsr_sharpening_slider"> | 521 | <layout class="QHBoxLayout" name="fsr_sharpening_label_group"> |
| 535 | <property name="sizePolicy"> | 522 | <item> |
| 536 | <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> | 523 | <widget class="QComboBox" name="fsr_sharpening_combobox"> |
| 537 | <horstretch>0</horstretch> | 524 | <property name="sizePolicy"> |
| 538 | <verstretch>0</verstretch> | 525 | <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> |
| 539 | </sizepolicy> | 526 | <horstretch>0</horstretch> |
| 540 | </property> | 527 | <verstretch>0</verstretch> |
| 541 | <property name="baseSize"> | 528 | </sizepolicy> |
| 542 | <size> | 529 | </property> |
| 543 | <width>0</width> | 530 | <item> |
| 544 | <height>0</height> | 531 | <property name="text"> |
| 545 | </size> | 532 | <string>Use global FSR Sharpening</string> |
| 546 | </property> | 533 | </property> |
| 547 | <property name="maximum"> | 534 | </item> |
| 548 | <number>200</number> | 535 | <item> |
| 549 | </property> | 536 | <property name="text"> |
| 550 | <property name="sliderPosition"> | 537 | <string>Set FSR Sharpening</string> |
| 551 | <number>25</number> | 538 | </property> |
| 552 | </property> | 539 | </item> |
| 553 | <property name="orientation"> | 540 | </widget> |
| 554 | <enum>Qt::Horizontal</enum> | 541 | </item> |
| 555 | </property> | 542 | <item> |
| 556 | <property name="invertedAppearance"> | 543 | <widget class="QLabel" name="fsr_sharpening_label"> |
| 557 | <bool>true</bool> | 544 | <property name="sizePolicy"> |
| 558 | </property> | 545 | <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> |
| 559 | </widget> | 546 | <horstretch>0</horstretch> |
| 547 | <verstretch>0</verstretch> | ||
| 548 | </sizepolicy> | ||
| 549 | </property> | ||
| 550 | <property name="text"> | ||
| 551 | <string>FSR Sharpening:</string> | ||
| 552 | </property> | ||
| 553 | </widget> | ||
| 554 | </item> | ||
| 555 | <item> | ||
| 556 | <spacer name="horizontalSpacer_2"> | ||
| 557 | <property name="orientation"> | ||
| 558 | <enum>Qt::Horizontal</enum> | ||
| 559 | </property> | ||
| 560 | <property name="sizeHint" stdset="0"> | ||
| 561 | <size> | ||
| 562 | <width>40</width> | ||
| 563 | <height>20</height> | ||
| 564 | </size> | ||
| 565 | </property> | ||
| 566 | </spacer> | ||
| 567 | </item> | ||
| 568 | </layout> | ||
| 560 | </item> | 569 | </item> |
| 561 | <item> | 570 | <item> |
| 562 | <widget class="QLabel" name="fsr_sharpening_value"> | 571 | <layout class="QHBoxLayout" name="fsr_slider_layout"> |
| 563 | <property name="sizePolicy"> | 572 | <property name="spacing"> |
| 564 | <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> | 573 | <number>6</number> |
| 565 | <horstretch>0</horstretch> | ||
| 566 | <verstretch>0</verstretch> | ||
| 567 | </sizepolicy> | ||
| 568 | </property> | ||
| 569 | <property name="minimumSize"> | ||
| 570 | <size> | ||
| 571 | <width>32</width> | ||
| 572 | <height>0</height> | ||
| 573 | </size> | ||
| 574 | </property> | ||
| 575 | <property name="text"> | ||
| 576 | <string>100%</string> | ||
| 577 | </property> | 574 | </property> |
| 578 | <property name="alignment"> | 575 | <item> |
| 579 | <set>Qt::AlignCenter</set> | 576 | <widget class="QSlider" name="fsr_sharpening_slider"> |
| 580 | </property> | 577 | <property name="sizePolicy"> |
| 581 | </widget> | 578 | <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> |
| 579 | <horstretch>0</horstretch> | ||
| 580 | <verstretch>0</verstretch> | ||
| 581 | </sizepolicy> | ||
| 582 | </property> | ||
| 583 | <property name="baseSize"> | ||
| 584 | <size> | ||
| 585 | <width>0</width> | ||
| 586 | <height>0</height> | ||
| 587 | </size> | ||
| 588 | </property> | ||
| 589 | <property name="maximum"> | ||
| 590 | <number>200</number> | ||
| 591 | </property> | ||
| 592 | <property name="sliderPosition"> | ||
| 593 | <number>25</number> | ||
| 594 | </property> | ||
| 595 | <property name="orientation"> | ||
| 596 | <enum>Qt::Horizontal</enum> | ||
| 597 | </property> | ||
| 598 | <property name="invertedAppearance"> | ||
| 599 | <bool>true</bool> | ||
| 600 | </property> | ||
| 601 | </widget> | ||
| 602 | </item> | ||
| 603 | <item> | ||
| 604 | <widget class="QLabel" name="fsr_sharpening_value"> | ||
| 605 | <property name="sizePolicy"> | ||
| 606 | <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> | ||
| 607 | <horstretch>0</horstretch> | ||
| 608 | <verstretch>0</verstretch> | ||
| 609 | </sizepolicy> | ||
| 610 | </property> | ||
| 611 | <property name="minimumSize"> | ||
| 612 | <size> | ||
| 613 | <width>32</width> | ||
| 614 | <height>0</height> | ||
| 615 | </size> | ||
| 616 | </property> | ||
| 617 | <property name="text"> | ||
| 618 | <string>100%</string> | ||
| 619 | </property> | ||
| 620 | <property name="alignment"> | ||
| 621 | <set>Qt::AlignCenter</set> | ||
| 622 | </property> | ||
| 623 | </widget> | ||
| 624 | </item> | ||
| 625 | </layout> | ||
| 582 | </item> | 626 | </item> |
| 583 | </layout> | 627 | </layout> |
| 584 | <zorder>fsr_sharpening_value</zorder> | ||
| 585 | <zorder>fsr_sharpening_label</zorder> | ||
| 586 | <zorder>fsr_sharpening_slider</zorder> | ||
| 587 | </widget> | 628 | </widget> |
| 588 | </item> | 629 | </item> |
| 589 | <item> | 630 | <item> |