2021-12-10 02:10:24 +00:00
|
|
|
// Copyright 2017 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2017-06-15 23:43:14 +00:00
|
|
|
|
2018-07-06 22:40:15 +00:00
|
|
|
#include "DolphinQt/Config/Graphics/GeneralWidget.h"
|
2017-06-15 23:43:14 +00:00
|
|
|
|
|
|
|
#include <QCheckBox>
|
|
|
|
#include <QComboBox>
|
|
|
|
#include <QGridLayout>
|
|
|
|
#include <QGroupBox>
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
#include <QLabel>
|
2018-03-16 13:10:22 +00:00
|
|
|
#include <QRadioButton>
|
2018-08-23 11:11:52 +00:00
|
|
|
#include <QSignalBlocker>
|
2017-06-15 23:43:14 +00:00
|
|
|
#include <QVBoxLayout>
|
|
|
|
|
|
|
|
#include "Core/Config/GraphicsSettings.h"
|
2019-03-03 04:41:50 +00:00
|
|
|
#include "Core/Config/MainSettings.h"
|
2017-06-15 23:43:14 +00:00
|
|
|
#include "Core/ConfigManager.h"
|
2017-09-04 18:12:13 +00:00
|
|
|
#include "Core/Core.h"
|
2018-05-28 01:48:04 +00:00
|
|
|
|
2023-04-21 21:02:53 +00:00
|
|
|
#include "DolphinQt/Config/ConfigControls/ConfigBool.h"
|
2023-04-25 03:36:43 +00:00
|
|
|
#include "DolphinQt/Config/ConfigControls/ConfigChoice.h"
|
2023-12-12 22:27:01 +00:00
|
|
|
#include "DolphinQt/Config/ConfigControls/ConfigInteger.h"
|
2023-04-27 17:39:48 +00:00
|
|
|
#include "DolphinQt/Config/ConfigControls/ConfigRadio.h"
|
2018-07-06 22:40:15 +00:00
|
|
|
#include "DolphinQt/Config/Graphics/GraphicsWindow.h"
|
2020-10-17 05:06:34 +00:00
|
|
|
#include "DolphinQt/Config/ToolTipControls/ToolTipComboBox.h"
|
2019-03-04 19:49:00 +00:00
|
|
|
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
2023-07-30 22:42:15 +00:00
|
|
|
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
2018-07-06 22:40:15 +00:00
|
|
|
#include "DolphinQt/Settings.h"
|
2018-05-28 01:48:04 +00:00
|
|
|
|
2017-06-15 23:43:14 +00:00
|
|
|
#include "VideoCommon/VideoBackendBase.h"
|
|
|
|
#include "VideoCommon/VideoConfig.h"
|
|
|
|
|
2023-04-26 22:35:40 +00:00
|
|
|
GeneralWidget::GeneralWidget(GraphicsWindow* parent)
|
2017-06-15 23:43:14 +00:00
|
|
|
{
|
|
|
|
CreateWidgets();
|
|
|
|
LoadSettings();
|
|
|
|
ConnectWidgets();
|
|
|
|
AddDescriptions();
|
2020-05-03 23:21:51 +00:00
|
|
|
emit BackendChanged(QString::fromStdString(Config::Get(Config::MAIN_GFX_BACKEND)));
|
2017-06-15 23:43:14 +00:00
|
|
|
|
|
|
|
connect(parent, &GraphicsWindow::BackendChanged, this, &GeneralWidget::OnBackendChanged);
|
2022-08-08 01:25:19 +00:00
|
|
|
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, [this](Core::State state) {
|
|
|
|
OnEmulationStateChanged(state != Core::State::Uninitialized);
|
|
|
|
});
|
2018-07-13 10:38:21 +00:00
|
|
|
OnEmulationStateChanged(Core::GetState() != Core::State::Uninitialized);
|
2017-06-15 23:43:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void GeneralWidget::CreateWidgets()
|
|
|
|
{
|
|
|
|
auto* main_layout = new QVBoxLayout;
|
|
|
|
|
2017-07-23 10:58:32 +00:00
|
|
|
// Basic Section
|
|
|
|
auto* m_video_box = new QGroupBox(tr("Basic"));
|
2017-06-15 23:43:14 +00:00
|
|
|
m_video_layout = new QGridLayout();
|
|
|
|
|
2020-10-17 05:06:34 +00:00
|
|
|
m_backend_combo = new ToolTipComboBox();
|
2023-12-18 00:37:19 +00:00
|
|
|
m_aspect_combo = new ConfigChoice({tr("Auto"), tr("Force 16:9"), tr("Force 4:3"),
|
|
|
|
tr("Stretch to Window"), tr("Custom"), tr("Custom (Stretch)")},
|
|
|
|
Config::GFX_ASPECT_RATIO);
|
2023-12-12 22:27:01 +00:00
|
|
|
m_custom_aspect_label = new QLabel(tr("Custom Aspect Ratio:"));
|
|
|
|
m_custom_aspect_label->setHidden(true);
|
|
|
|
constexpr int MAX_CUSTOM_ASPECT_RATIO_RESOLUTION = 10000;
|
|
|
|
m_custom_aspect_width = new ConfigInteger(1, MAX_CUSTOM_ASPECT_RATIO_RESOLUTION,
|
|
|
|
Config::GFX_CUSTOM_ASPECT_RATIO_WIDTH);
|
|
|
|
m_custom_aspect_width->setEnabled(false);
|
|
|
|
m_custom_aspect_width->setHidden(true);
|
|
|
|
m_custom_aspect_height = new ConfigInteger(1, MAX_CUSTOM_ASPECT_RATIO_RESOLUTION,
|
|
|
|
Config::GFX_CUSTOM_ASPECT_RATIO_HEIGHT);
|
|
|
|
m_custom_aspect_height->setEnabled(false);
|
|
|
|
m_custom_aspect_height->setHidden(true);
|
2020-10-17 05:06:34 +00:00
|
|
|
m_adapter_combo = new ToolTipComboBox;
|
2023-04-21 21:02:53 +00:00
|
|
|
m_enable_vsync = new ConfigBool(tr("V-Sync"), Config::GFX_VSYNC);
|
|
|
|
m_enable_fullscreen = new ConfigBool(tr("Start in Fullscreen"), Config::MAIN_FULLSCREEN);
|
2017-06-15 23:43:14 +00:00
|
|
|
|
|
|
|
m_video_box->setLayout(m_video_layout);
|
|
|
|
|
2020-10-21 19:34:38 +00:00
|
|
|
for (auto& backend : VideoBackendBase::GetAvailableBackends())
|
|
|
|
{
|
2018-06-30 08:28:45 +00:00
|
|
|
m_backend_combo->addItem(tr(backend->GetDisplayName().c_str()),
|
|
|
|
QVariant(QString::fromStdString(backend->GetName())));
|
2020-10-21 19:34:38 +00:00
|
|
|
}
|
2017-06-15 23:43:14 +00:00
|
|
|
|
|
|
|
m_video_layout->addWidget(new QLabel(tr("Backend:")), 0, 0);
|
2023-12-12 22:27:01 +00:00
|
|
|
m_video_layout->addWidget(m_backend_combo, 0, 1, 1, -1);
|
2017-11-17 20:55:43 +00:00
|
|
|
|
2017-06-15 23:43:14 +00:00
|
|
|
m_video_layout->addWidget(new QLabel(tr("Adapter:")), 1, 0);
|
2023-12-12 22:27:01 +00:00
|
|
|
m_video_layout->addWidget(m_adapter_combo, 1, 1, 1, -1);
|
2017-06-15 23:43:14 +00:00
|
|
|
|
|
|
|
m_video_layout->addWidget(new QLabel(tr("Aspect Ratio:")), 3, 0);
|
2023-12-12 22:27:01 +00:00
|
|
|
m_video_layout->addWidget(m_aspect_combo, 3, 1, 1, -1);
|
2017-06-15 23:43:14 +00:00
|
|
|
|
2023-12-12 22:27:01 +00:00
|
|
|
m_video_layout->addWidget(m_custom_aspect_label, 4, 0);
|
|
|
|
m_video_layout->addWidget(m_custom_aspect_width, 4, 1);
|
|
|
|
m_video_layout->addWidget(m_custom_aspect_height, 4, 2);
|
|
|
|
|
|
|
|
m_video_layout->addWidget(m_enable_vsync, 5, 0);
|
|
|
|
m_video_layout->addWidget(m_enable_fullscreen, 5, 1, 1, -1);
|
2017-06-15 23:43:14 +00:00
|
|
|
|
2017-07-23 10:58:32 +00:00
|
|
|
// Other
|
|
|
|
auto* m_options_box = new QGroupBox(tr("Other"));
|
2017-06-15 23:43:14 +00:00
|
|
|
auto* m_options_layout = new QGridLayout();
|
|
|
|
|
2023-04-21 21:02:53 +00:00
|
|
|
m_show_ping = new ConfigBool(tr("Show NetPlay Ping"), Config::GFX_SHOW_NETPLAY_PING);
|
2019-03-03 04:41:50 +00:00
|
|
|
m_autoadjust_window_size =
|
2023-04-21 21:02:53 +00:00
|
|
|
new ConfigBool(tr("Auto-Adjust Window Size"), Config::MAIN_RENDER_WINDOW_AUTOSIZE);
|
|
|
|
m_show_messages = new ConfigBool(tr("Show NetPlay Messages"), Config::GFX_SHOW_NETPLAY_MESSAGES);
|
|
|
|
m_render_main_window = new ConfigBool(tr("Render to Main Window"), Config::MAIN_RENDER_TO_MAIN);
|
2017-06-15 23:43:14 +00:00
|
|
|
|
|
|
|
m_options_box->setLayout(m_options_layout);
|
|
|
|
|
2022-10-26 19:17:15 +00:00
|
|
|
m_options_layout->addWidget(m_render_main_window, 0, 0);
|
|
|
|
m_options_layout->addWidget(m_autoadjust_window_size, 1, 0);
|
2017-06-15 23:43:14 +00:00
|
|
|
|
2022-10-26 19:17:15 +00:00
|
|
|
m_options_layout->addWidget(m_show_messages, 0, 1);
|
|
|
|
m_options_layout->addWidget(m_show_ping, 1, 1);
|
2018-03-16 13:10:22 +00:00
|
|
|
|
|
|
|
// Other
|
|
|
|
auto* shader_compilation_box = new QGroupBox(tr("Shader Compilation"));
|
|
|
|
auto* shader_compilation_layout = new QGridLayout();
|
|
|
|
|
|
|
|
const std::array<const char*, 4> modes = {{
|
2019-10-19 09:26:18 +00:00
|
|
|
QT_TR_NOOP("Specialized (Default)"),
|
|
|
|
QT_TR_NOOP("Exclusive Ubershaders"),
|
|
|
|
QT_TR_NOOP("Hybrid Ubershaders"),
|
|
|
|
QT_TR_NOOP("Skip Drawing"),
|
2018-03-16 13:10:22 +00:00
|
|
|
}};
|
|
|
|
for (size_t i = 0; i < modes.size(); i++)
|
|
|
|
{
|
2023-04-27 17:39:48 +00:00
|
|
|
m_shader_compilation_mode[i] =
|
|
|
|
new ConfigRadioInt(tr(modes[i]), Config::GFX_SHADER_COMPILATION_MODE, static_cast<int>(i));
|
2018-03-16 13:10:22 +00:00
|
|
|
shader_compilation_layout->addWidget(m_shader_compilation_mode[i], static_cast<int>(i / 2),
|
|
|
|
static_cast<int>(i % 2));
|
|
|
|
}
|
2023-04-21 21:02:53 +00:00
|
|
|
m_wait_for_shaders = new ConfigBool(tr("Compile Shaders Before Starting"),
|
|
|
|
Config::GFX_WAIT_FOR_SHADERS_BEFORE_STARTING);
|
2018-03-16 13:10:22 +00:00
|
|
|
shader_compilation_layout->addWidget(m_wait_for_shaders);
|
|
|
|
shader_compilation_box->setLayout(shader_compilation_layout);
|
2017-06-15 23:43:14 +00:00
|
|
|
|
|
|
|
main_layout->addWidget(m_video_box);
|
|
|
|
main_layout->addWidget(m_options_box);
|
2018-03-16 13:10:22 +00:00
|
|
|
main_layout->addWidget(shader_compilation_box);
|
2017-09-14 16:48:20 +00:00
|
|
|
main_layout->addStretch();
|
2017-06-15 23:43:14 +00:00
|
|
|
|
|
|
|
setLayout(main_layout);
|
|
|
|
}
|
|
|
|
|
|
|
|
void GeneralWidget::ConnectWidgets()
|
|
|
|
{
|
|
|
|
// Video Backend
|
2023-11-04 21:01:39 +00:00
|
|
|
connect(m_backend_combo, &QComboBox::currentIndexChanged, this, &GeneralWidget::SaveSettings);
|
|
|
|
connect(m_adapter_combo, &QComboBox::currentIndexChanged, this, [&](int index) {
|
2019-07-30 13:35:46 +00:00
|
|
|
g_Config.iAdapter = index;
|
|
|
|
Config::SetBaseOrCurrent(Config::GFX_ADAPTER, index);
|
2022-05-16 23:28:18 +00:00
|
|
|
emit BackendChanged(QString::fromStdString(Config::Get(Config::MAIN_GFX_BACKEND)));
|
2019-07-30 13:35:46 +00:00
|
|
|
});
|
2023-12-12 22:27:01 +00:00
|
|
|
connect(m_aspect_combo, qOverload<int>(&QComboBox::currentIndexChanged), this, [&](int index) {
|
2023-12-18 00:37:19 +00:00
|
|
|
const bool is_custom_aspect_ratio = (index == static_cast<int>(AspectMode::Custom)) ||
|
|
|
|
(index == static_cast<int>(AspectMode::CustomStretch));
|
2023-12-12 22:27:01 +00:00
|
|
|
m_custom_aspect_width->setEnabled(is_custom_aspect_ratio);
|
|
|
|
m_custom_aspect_height->setEnabled(is_custom_aspect_ratio);
|
|
|
|
m_custom_aspect_label->setHidden(!is_custom_aspect_ratio);
|
|
|
|
m_custom_aspect_width->setHidden(!is_custom_aspect_ratio);
|
|
|
|
m_custom_aspect_height->setHidden(!is_custom_aspect_ratio);
|
|
|
|
});
|
2017-06-15 23:43:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void GeneralWidget::LoadSettings()
|
|
|
|
{
|
|
|
|
// Video Backend
|
2018-06-30 08:28:45 +00:00
|
|
|
m_backend_combo->setCurrentIndex(m_backend_combo->findData(
|
2020-05-03 23:21:51 +00:00
|
|
|
QVariant(QString::fromStdString(Config::Get(Config::MAIN_GFX_BACKEND)))));
|
2023-12-12 22:27:01 +00:00
|
|
|
|
2023-12-18 00:37:19 +00:00
|
|
|
const bool is_custom_aspect_ratio =
|
|
|
|
(Config::Get(Config::GFX_ASPECT_RATIO) == AspectMode::Custom) ||
|
|
|
|
(Config::Get(Config::GFX_ASPECT_RATIO) == AspectMode::CustomStretch);
|
2023-12-12 22:27:01 +00:00
|
|
|
m_custom_aspect_width->setEnabled(is_custom_aspect_ratio);
|
|
|
|
m_custom_aspect_height->setEnabled(is_custom_aspect_ratio);
|
|
|
|
m_custom_aspect_label->setHidden(!is_custom_aspect_ratio);
|
|
|
|
m_custom_aspect_width->setHidden(!is_custom_aspect_ratio);
|
|
|
|
m_custom_aspect_height->setHidden(!is_custom_aspect_ratio);
|
2017-06-15 23:43:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void GeneralWidget::SaveSettings()
|
|
|
|
{
|
|
|
|
// Video Backend
|
2018-06-30 08:28:45 +00:00
|
|
|
const auto current_backend = m_backend_combo->currentData().toString().toStdString();
|
2023-12-23 23:31:52 +00:00
|
|
|
if (Config::Get(Config::MAIN_GFX_BACKEND) == current_backend)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (Config::GetActiveLayerForConfig(Config::MAIN_GFX_BACKEND) == Config::LayerType::Base)
|
2017-06-15 23:43:14 +00:00
|
|
|
{
|
2020-10-21 19:34:38 +00:00
|
|
|
auto warningMessage = VideoBackendBase::GetAvailableBackends()[m_backend_combo->currentIndex()]
|
|
|
|
->GetWarningMessage();
|
2019-07-20 22:57:50 +00:00
|
|
|
if (warningMessage)
|
2017-06-15 23:43:14 +00:00
|
|
|
{
|
2019-03-04 19:49:00 +00:00
|
|
|
ModalMessageBox confirm_sw(this);
|
2018-06-30 08:28:45 +00:00
|
|
|
|
|
|
|
confirm_sw.setIcon(QMessageBox::Warning);
|
|
|
|
confirm_sw.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
|
|
|
confirm_sw.setWindowTitle(tr("Confirm backend change"));
|
2019-07-20 22:57:50 +00:00
|
|
|
confirm_sw.setText(tr(warningMessage->c_str()));
|
2018-06-30 08:28:45 +00:00
|
|
|
|
2023-07-30 22:42:15 +00:00
|
|
|
SetQWidgetWindowDecorations(&confirm_sw);
|
2018-06-30 08:28:45 +00:00
|
|
|
if (confirm_sw.exec() != QMessageBox::Yes)
|
2017-06-15 23:43:14 +00:00
|
|
|
{
|
2018-06-30 08:28:45 +00:00
|
|
|
m_backend_combo->setCurrentIndex(m_backend_combo->findData(
|
2020-05-03 23:21:51 +00:00
|
|
|
QVariant(QString::fromStdString(Config::Get(Config::MAIN_GFX_BACKEND)))));
|
2018-06-30 08:28:45 +00:00
|
|
|
return;
|
2017-06-15 23:43:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-12-23 23:31:52 +00:00
|
|
|
|
|
|
|
Config::SetBaseOrCurrent(Config::MAIN_GFX_BACKEND, current_backend);
|
|
|
|
emit BackendChanged(QString::fromStdString(current_backend));
|
2017-06-15 23:43:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void GeneralWidget::OnEmulationStateChanged(bool running)
|
|
|
|
{
|
|
|
|
m_backend_combo->setEnabled(!running);
|
|
|
|
m_render_main_window->setEnabled(!running);
|
2020-12-31 11:39:45 +00:00
|
|
|
m_enable_fullscreen->setEnabled(!running);
|
2017-06-15 23:43:14 +00:00
|
|
|
|
2019-08-20 18:08:14 +00:00
|
|
|
const bool supports_adapters = !g_Config.backend_info.Adapters.empty();
|
|
|
|
m_adapter_combo->setEnabled(!running && supports_adapters);
|
2023-12-23 23:31:52 +00:00
|
|
|
|
|
|
|
std::string current_backend = m_backend_combo->currentData().toString().toStdString();
|
|
|
|
if (Config::Get(Config::MAIN_GFX_BACKEND) != current_backend)
|
|
|
|
emit BackendChanged(QString::fromStdString(Config::Get(Config::MAIN_GFX_BACKEND)));
|
2017-06-15 23:43:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void GeneralWidget::AddDescriptions()
|
|
|
|
{
|
2021-05-02 18:55:10 +00:00
|
|
|
// We need QObject::tr
|
2018-06-18 16:32:24 +00:00
|
|
|
static const char TR_BACKEND_DESCRIPTION[] = QT_TR_NOOP(
|
2020-10-17 05:06:34 +00:00
|
|
|
"Selects which graphics API to use internally.<br><br>The software renderer is extremely "
|
2021-05-02 18:55:10 +00:00
|
|
|
"slow and only useful for debugging, so any of the other backends are "
|
2019-01-27 21:59:39 +00:00
|
|
|
"recommended. Different games and different GPUs will behave differently on each "
|
2018-06-18 16:32:24 +00:00
|
|
|
"backend, so for the best emulation experience it is recommended to try each and "
|
2020-10-17 05:06:34 +00:00
|
|
|
"select the backend that is least problematic.<br><br><dolphin_emphasis>If unsure, "
|
|
|
|
"select OpenGL.</dolphin_emphasis>");
|
2019-01-27 21:59:39 +00:00
|
|
|
static const char TR_FULLSCREEN_DESCRIPTION[] =
|
2020-10-17 05:06:34 +00:00
|
|
|
QT_TR_NOOP("Uses the entire screen for rendering.<br><br>If disabled, a "
|
|
|
|
"render window will be created instead.<br><br><dolphin_emphasis>If "
|
|
|
|
"unsure, leave this unchecked.</dolphin_emphasis>");
|
2018-06-06 13:05:18 +00:00
|
|
|
static const char TR_AUTOSIZE_DESCRIPTION[] =
|
2020-10-17 05:06:34 +00:00
|
|
|
QT_TR_NOOP("Automatically adjusts the window size to the internal resolution.<br><br>"
|
|
|
|
"<dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>");
|
2018-06-06 13:05:18 +00:00
|
|
|
static const char TR_RENDER_TO_MAINWINDOW_DESCRIPTION[] =
|
2019-01-27 21:59:39 +00:00
|
|
|
QT_TR_NOOP("Uses the main Dolphin window for rendering rather than "
|
2020-10-17 05:06:34 +00:00
|
|
|
"a separate render window.<br><br><dolphin_emphasis>If unsure, leave "
|
|
|
|
"this unchecked.</dolphin_emphasis>");
|
2023-12-18 00:37:19 +00:00
|
|
|
static const char TR_ASPECT_RATIO_DESCRIPTION[] = QT_TR_NOOP(
|
|
|
|
"Selects which aspect ratio to use when drawing on the render window.<br>"
|
|
|
|
"Each game can have a slightly different native aspect ratio.<br>They can vary by "
|
|
|
|
"scene and settings and rarely ever exactly match 4:3 or 16:9."
|
|
|
|
"<br><br><b>Auto</b>: Uses the native aspect ratio"
|
|
|
|
"<br><br><b>Force 16:9</b>: Mimics an analog TV with a widescreen aspect ratio."
|
|
|
|
"<br><br><b>Force 4:3</b>: Mimics a standard 4:3 analog TV."
|
|
|
|
"<br><br><b>Stretch to Window</b>: Stretches the picture to the window size."
|
|
|
|
"<br><br><b>Custom</b>: Forces the specified aspect ratio."
|
|
|
|
"<br>This is mostly intended to be used with aspect ratio cheats/mods."
|
|
|
|
"<br><br><b>Custom (Stretch)</b>: Similar to `Custom` but not relative to the "
|
|
|
|
"title's native aspect ratio.<br>This is not meant to be used under normal circumstances."
|
|
|
|
"<br><br><dolphin_emphasis>If unsure, select Auto.</dolphin_emphasis>");
|
2020-10-17 05:06:34 +00:00
|
|
|
static const char TR_VSYNC_DESCRIPTION[] = QT_TR_NOOP(
|
|
|
|
"Waits for vertical blanks in order to prevent tearing.<br><br>Decreases performance "
|
|
|
|
"if emulation speed is below 100%.<br><br><dolphin_emphasis>If unsure, leave "
|
|
|
|
"this "
|
|
|
|
"unchecked.</dolphin_emphasis>");
|
|
|
|
static const char TR_SHOW_NETPLAY_PING_DESCRIPTION[] = QT_TR_NOOP(
|
|
|
|
"Shows the player's maximum ping while playing on "
|
|
|
|
"NetPlay.<br><br><dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>");
|
2018-06-06 13:05:18 +00:00
|
|
|
static const char TR_SHOW_NETPLAY_MESSAGES_DESCRIPTION[] =
|
2019-01-27 21:59:39 +00:00
|
|
|
QT_TR_NOOP("Shows chat messages, buffer changes, and desync alerts "
|
2020-10-17 05:06:34 +00:00
|
|
|
"while playing NetPlay.<br><br><dolphin_emphasis>If unsure, leave "
|
|
|
|
"this unchecked.</dolphin_emphasis>");
|
2019-10-19 09:26:18 +00:00
|
|
|
static const char TR_SHADER_COMPILE_SPECIALIZED_DESCRIPTION[] =
|
2018-03-16 13:10:22 +00:00
|
|
|
QT_TR_NOOP("Ubershaders are never used. Stuttering will occur during shader "
|
2020-10-17 05:06:34 +00:00
|
|
|
"compilation, but GPU demands are low.<br><br>Recommended for low-end hardware. "
|
|
|
|
"<br><br><dolphin_emphasis>If unsure, select this mode.</dolphin_emphasis>");
|
2019-10-19 09:26:18 +00:00
|
|
|
// The "very powerful GPU" mention below is by 2021 PC GPU standards
|
|
|
|
static const char TR_SHADER_COMPILE_EXCLUSIVE_UBER_DESCRIPTION[] = QT_TR_NOOP(
|
2018-05-01 22:57:34 +00:00
|
|
|
"Ubershaders will always be used. Provides a near stutter-free experience at the cost of "
|
2019-10-19 09:26:18 +00:00
|
|
|
"very high GPU performance requirements.<br><br><dolphin_emphasis>Don't use this unless you "
|
|
|
|
"encountered stuttering with Hybrid Ubershaders and have a very powerful "
|
|
|
|
"GPU.</dolphin_emphasis>");
|
|
|
|
static const char TR_SHADER_COMPILE_HYBRID_UBER_DESCRIPTION[] = QT_TR_NOOP(
|
2020-10-17 05:06:34 +00:00
|
|
|
"Ubershaders will be used to prevent stuttering during shader compilation, but "
|
|
|
|
"specialized shaders will be used when they will not cause stuttering.<br><br>In the "
|
|
|
|
"best case it eliminates shader compilation stuttering while having minimal "
|
|
|
|
"performance impact, but results depend on video driver behavior.");
|
2019-10-19 09:26:18 +00:00
|
|
|
static const char TR_SHADER_COMPILE_SKIP_DRAWING_DESCRIPTION[] = QT_TR_NOOP(
|
2018-05-01 22:57:34 +00:00
|
|
|
"Prevents shader compilation stuttering by not rendering waiting objects. Can work in "
|
|
|
|
"scenarios where Ubershaders doesn't, at the cost of introducing visual glitches and broken "
|
2020-10-17 05:06:34 +00:00
|
|
|
"effects.<br><br><dolphin_emphasis>Not recommended, only use if the other "
|
|
|
|
"options give poor results.</dolphin_emphasis>");
|
2018-06-06 13:05:18 +00:00
|
|
|
static const char TR_SHADER_COMPILE_BEFORE_START_DESCRIPTION[] =
|
2018-03-16 13:10:22 +00:00
|
|
|
QT_TR_NOOP("Waits for all shaders to finish compiling before starting a game. Enabling this "
|
|
|
|
"option may reduce stuttering or hitching for a short time after the game is "
|
|
|
|
"started, at the cost of a longer delay before the game starts. For systems with "
|
|
|
|
"two or fewer cores, it is recommended to enable this option, as a large shader "
|
2020-10-17 05:06:34 +00:00
|
|
|
"queue may reduce frame rates.<br><br><dolphin_emphasis>Otherwise, if "
|
|
|
|
"unsure, leave this unchecked.</dolphin_emphasis>");
|
|
|
|
|
|
|
|
m_backend_combo->SetTitle(tr("Backend"));
|
2020-11-30 13:04:08 +00:00
|
|
|
m_backend_combo->SetDescription(tr(TR_BACKEND_DESCRIPTION));
|
2020-10-17 05:06:34 +00:00
|
|
|
|
|
|
|
m_adapter_combo->SetTitle(tr("Adapter"));
|
|
|
|
|
|
|
|
m_aspect_combo->SetTitle(tr("Aspect Ratio"));
|
2020-11-30 13:04:08 +00:00
|
|
|
m_aspect_combo->SetDescription(tr(TR_ASPECT_RATIO_DESCRIPTION));
|
2020-10-17 05:06:34 +00:00
|
|
|
|
2023-12-12 22:27:01 +00:00
|
|
|
m_custom_aspect_width->SetTitle(tr("Custom Aspect Ratio Width"));
|
|
|
|
m_custom_aspect_height->SetTitle(tr("Custom Aspect Ratio Height"));
|
|
|
|
|
2020-11-30 13:04:08 +00:00
|
|
|
m_enable_vsync->SetDescription(tr(TR_VSYNC_DESCRIPTION));
|
2020-10-17 05:06:34 +00:00
|
|
|
|
2020-11-30 13:04:08 +00:00
|
|
|
m_enable_fullscreen->SetDescription(tr(TR_FULLSCREEN_DESCRIPTION));
|
2020-10-17 05:06:34 +00:00
|
|
|
|
2020-11-30 13:04:08 +00:00
|
|
|
m_show_ping->SetDescription(tr(TR_SHOW_NETPLAY_PING_DESCRIPTION));
|
2020-10-17 05:06:34 +00:00
|
|
|
|
2020-11-30 13:04:08 +00:00
|
|
|
m_autoadjust_window_size->SetDescription(tr(TR_AUTOSIZE_DESCRIPTION));
|
2020-10-17 05:06:34 +00:00
|
|
|
|
2020-11-30 13:04:08 +00:00
|
|
|
m_show_messages->SetDescription(tr(TR_SHOW_NETPLAY_MESSAGES_DESCRIPTION));
|
2020-10-17 05:06:34 +00:00
|
|
|
|
2020-11-30 13:04:08 +00:00
|
|
|
m_render_main_window->SetDescription(tr(TR_RENDER_TO_MAINWINDOW_DESCRIPTION));
|
2020-10-17 05:06:34 +00:00
|
|
|
|
2019-10-19 09:26:18 +00:00
|
|
|
m_shader_compilation_mode[0]->SetDescription(tr(TR_SHADER_COMPILE_SPECIALIZED_DESCRIPTION));
|
2020-10-17 05:06:34 +00:00
|
|
|
|
2019-10-19 09:26:18 +00:00
|
|
|
m_shader_compilation_mode[1]->SetDescription(tr(TR_SHADER_COMPILE_EXCLUSIVE_UBER_DESCRIPTION));
|
2020-10-17 05:06:34 +00:00
|
|
|
|
2019-10-19 09:26:18 +00:00
|
|
|
m_shader_compilation_mode[2]->SetDescription(tr(TR_SHADER_COMPILE_HYBRID_UBER_DESCRIPTION));
|
2020-10-17 05:06:34 +00:00
|
|
|
|
2019-10-19 09:26:18 +00:00
|
|
|
m_shader_compilation_mode[3]->SetDescription(tr(TR_SHADER_COMPILE_SKIP_DRAWING_DESCRIPTION));
|
2020-10-17 05:06:34 +00:00
|
|
|
|
2020-11-30 13:04:08 +00:00
|
|
|
m_wait_for_shaders->SetDescription(tr(TR_SHADER_COMPILE_BEFORE_START_DESCRIPTION));
|
2017-06-15 23:43:14 +00:00
|
|
|
}
|
2018-05-02 17:14:38 +00:00
|
|
|
|
2017-06-15 23:43:14 +00:00
|
|
|
void GeneralWidget::OnBackendChanged(const QString& backend_name)
|
|
|
|
{
|
2018-06-30 08:28:45 +00:00
|
|
|
m_backend_combo->setCurrentIndex(m_backend_combo->findData(QVariant(backend_name)));
|
2017-06-15 23:43:14 +00:00
|
|
|
|
2018-08-23 11:11:52 +00:00
|
|
|
const QSignalBlocker blocker(m_adapter_combo);
|
2018-05-14 19:09:43 +00:00
|
|
|
|
2017-06-15 23:43:14 +00:00
|
|
|
m_adapter_combo->clear();
|
|
|
|
|
2018-05-02 17:14:38 +00:00
|
|
|
const auto& adapters = g_Config.backend_info.Adapters;
|
|
|
|
|
|
|
|
for (const auto& adapter : adapters)
|
2017-06-15 23:43:14 +00:00
|
|
|
m_adapter_combo->addItem(QString::fromStdString(adapter));
|
|
|
|
|
2018-05-31 01:52:18 +00:00
|
|
|
const bool supports_adapters = !adapters.empty();
|
|
|
|
|
2017-06-15 23:43:14 +00:00
|
|
|
m_adapter_combo->setCurrentIndex(g_Config.iAdapter);
|
2018-09-28 12:01:23 +00:00
|
|
|
m_adapter_combo->setEnabled(supports_adapters && !Core::IsRunning());
|
2018-05-31 01:52:18 +00:00
|
|
|
|
2021-05-02 19:58:41 +00:00
|
|
|
static constexpr char TR_ADAPTER_AVAILABLE_DESCRIPTION[] =
|
|
|
|
QT_TR_NOOP("Selects a hardware adapter to use.<br><br>"
|
|
|
|
"<dolphin_emphasis>If unsure, select the first one.</dolphin_emphasis>");
|
|
|
|
static constexpr char TR_ADAPTER_UNAVAILABLE_DESCRIPTION[] =
|
|
|
|
QT_TR_NOOP("Selects a hardware adapter to use.<br><br>"
|
|
|
|
"<dolphin_emphasis>%1 doesn't support this feature.</dolphin_emphasis>");
|
|
|
|
|
|
|
|
m_adapter_combo->SetDescription(supports_adapters ?
|
|
|
|
tr(TR_ADAPTER_AVAILABLE_DESCRIPTION) :
|
|
|
|
tr(TR_ADAPTER_UNAVAILABLE_DESCRIPTION)
|
|
|
|
.arg(tr(g_video_backend->GetDisplayName().c_str())));
|
2017-06-15 23:43:14 +00:00
|
|
|
}
|