mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-31 21:28:51 +00:00
Merge branch 'master' of https://github.com/dolphin-emu/dolphin into dolphin-emu-maste2r
This commit is contained in:
commit
75a9451d0b
218 changed files with 53095 additions and 44354 deletions
|
@ -3,11 +3,9 @@
|
|||
|
||||
#include "DolphinQt/Config/Graphics/AdvancedWidget.h"
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QGridLayout>
|
||||
#include <QGroupBox>
|
||||
#include <QLabel>
|
||||
#include <QSpinBox>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "Core/Config/GraphicsSettings.h"
|
||||
|
@ -19,6 +17,7 @@
|
|||
#include "DolphinQt/Config/ConfigControls/ConfigBool.h"
|
||||
#include "DolphinQt/Config/ConfigControls/ConfigChoice.h"
|
||||
#include "DolphinQt/Config/ConfigControls/ConfigInteger.h"
|
||||
#include "DolphinQt/Config/GameConfigWidget.h"
|
||||
#include "DolphinQt/Config/Graphics/GraphicsWindow.h"
|
||||
#include "DolphinQt/Config/ToolTipControls/ToolTipCheckBox.h"
|
||||
#include "DolphinQt/QtUtils/SignalBlocking.h"
|
||||
|
@ -29,7 +28,6 @@
|
|||
AdvancedWidget::AdvancedWidget(GraphicsWindow* parent)
|
||||
{
|
||||
CreateWidgets();
|
||||
LoadSettings();
|
||||
ConnectWidgets();
|
||||
AddDescriptions();
|
||||
|
||||
|
@ -37,17 +35,30 @@ AdvancedWidget::AdvancedWidget(GraphicsWindow* parent)
|
|||
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, [this](Core::State state) {
|
||||
OnEmulationStateChanged(state != Core::State::Uninitialized);
|
||||
});
|
||||
connect(m_manual_texture_sampling, &QCheckBox::toggled, [this, parent] {
|
||||
SaveSettings();
|
||||
emit parent->UseFastTextureSamplingChanged();
|
||||
});
|
||||
connect(m_manual_texture_sampling, &QCheckBox::toggled,
|
||||
[this, parent] { emit parent->UseFastTextureSamplingChanged(); });
|
||||
|
||||
OnBackendChanged();
|
||||
OnEmulationStateChanged(!Core::IsUninitialized(Core::System::GetInstance()));
|
||||
}
|
||||
|
||||
AdvancedWidget::AdvancedWidget(GameConfigWidget* parent, Config::Layer* layer) : m_game_layer(layer)
|
||||
{
|
||||
CreateWidgets();
|
||||
ConnectWidgets();
|
||||
AddDescriptions();
|
||||
|
||||
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, [this](Core::State state) {
|
||||
OnEmulationStateChanged(state != Core::State::Uninitialized);
|
||||
});
|
||||
OnEmulationStateChanged(Core::GetState(Core::System::GetInstance()) !=
|
||||
Core::State::Uninitialized);
|
||||
}
|
||||
|
||||
void AdvancedWidget::CreateWidgets()
|
||||
{
|
||||
const bool local_edit = m_game_layer != nullptr;
|
||||
|
||||
auto* main_layout = new QVBoxLayout;
|
||||
|
||||
// Performance
|
||||
|
@ -55,17 +66,19 @@ void AdvancedWidget::CreateWidgets()
|
|||
auto* performance_layout = new QGridLayout();
|
||||
performance_box->setLayout(performance_layout);
|
||||
|
||||
m_show_fps = new ConfigBool(tr("Show FPS"), Config::GFX_SHOW_FPS);
|
||||
m_show_ftimes = new ConfigBool(tr("Show Frame Times"), Config::GFX_SHOW_FTIMES);
|
||||
m_show_vps = new ConfigBool(tr("Show VPS"), Config::GFX_SHOW_VPS);
|
||||
m_show_vtimes = new ConfigBool(tr("Show VBlank Times"), Config::GFX_SHOW_VTIMES);
|
||||
m_show_graphs = new ConfigBool(tr("Show Performance Graphs"), Config::GFX_SHOW_GRAPHS);
|
||||
m_show_speed = new ConfigBool(tr("Show % Speed"), Config::GFX_SHOW_SPEED);
|
||||
m_show_speed_colors = new ConfigBool(tr("Show Speed Colors"), Config::GFX_SHOW_SPEED_COLORS);
|
||||
m_perf_samp_window = new ConfigInteger(0, 10000, Config::GFX_PERF_SAMP_WINDOW, 100);
|
||||
m_show_fps = new ConfigBool(tr("Show FPS"), Config::GFX_SHOW_FPS, m_game_layer);
|
||||
m_show_ftimes = new ConfigBool(tr("Show Frame Times"), Config::GFX_SHOW_FTIMES, m_game_layer);
|
||||
m_show_vps = new ConfigBool(tr("Show VPS"), Config::GFX_SHOW_VPS, m_game_layer);
|
||||
m_show_vtimes = new ConfigBool(tr("Show VBlank Times"), Config::GFX_SHOW_VTIMES, m_game_layer);
|
||||
m_show_graphs =
|
||||
new ConfigBool(tr("Show Performance Graphs"), Config::GFX_SHOW_GRAPHS, m_game_layer);
|
||||
m_show_speed = new ConfigBool(tr("Show % Speed"), Config::GFX_SHOW_SPEED, m_game_layer);
|
||||
m_show_speed_colors =
|
||||
new ConfigBool(tr("Show Speed Colors"), Config::GFX_SHOW_SPEED_COLORS, m_game_layer);
|
||||
m_perf_samp_window = new ConfigInteger(0, 10000, Config::GFX_PERF_SAMP_WINDOW, m_game_layer, 100);
|
||||
m_perf_samp_window->SetTitle(tr("Performance Sample Window (ms)"));
|
||||
m_log_render_time =
|
||||
new ConfigBool(tr("Log Render Time to File"), Config::GFX_LOG_RENDER_TIME_TO_FILE);
|
||||
m_log_render_time = new ConfigBool(tr("Log Render Time to File"),
|
||||
Config::GFX_LOG_RENDER_TIME_TO_FILE, m_game_layer);
|
||||
|
||||
performance_layout->addWidget(m_show_fps, 0, 0);
|
||||
performance_layout->addWidget(m_show_ftimes, 0, 1);
|
||||
|
@ -83,14 +96,16 @@ void AdvancedWidget::CreateWidgets()
|
|||
auto* debugging_layout = new QGridLayout();
|
||||
debugging_box->setLayout(debugging_layout);
|
||||
|
||||
m_enable_wireframe = new ConfigBool(tr("Enable Wireframe"), Config::GFX_ENABLE_WIREFRAME);
|
||||
m_show_statistics = new ConfigBool(tr("Show Statistics"), Config::GFX_OVERLAY_STATS);
|
||||
m_show_proj_statistics =
|
||||
new ConfigBool(tr("Show Projection Statistics"), Config::GFX_OVERLAY_PROJ_STATS);
|
||||
m_enable_wireframe =
|
||||
new ConfigBool(tr("Enable Wireframe"), Config::GFX_ENABLE_WIREFRAME, m_game_layer);
|
||||
m_show_statistics =
|
||||
new ConfigBool(tr("Show Statistics"), Config::GFX_OVERLAY_STATS, m_game_layer);
|
||||
m_show_proj_statistics = new ConfigBool(tr("Show Projection Statistics"),
|
||||
Config::GFX_OVERLAY_PROJ_STATS, m_game_layer);
|
||||
m_enable_format_overlay =
|
||||
new ConfigBool(tr("Texture Format Overlay"), Config::GFX_TEXFMT_OVERLAY_ENABLE);
|
||||
m_enable_api_validation =
|
||||
new ConfigBool(tr("Enable API Validation Layers"), Config::GFX_ENABLE_VALIDATION_LAYER);
|
||||
new ConfigBool(tr("Texture Format Overlay"), Config::GFX_TEXFMT_OVERLAY_ENABLE, m_game_layer);
|
||||
m_enable_api_validation = new ConfigBool(tr("Enable API Validation Layers"),
|
||||
Config::GFX_ENABLE_VALIDATION_LAYER, m_game_layer);
|
||||
|
||||
debugging_layout->addWidget(m_enable_wireframe, 0, 0);
|
||||
debugging_layout->addWidget(m_show_statistics, 0, 1);
|
||||
|
@ -103,14 +118,25 @@ void AdvancedWidget::CreateWidgets()
|
|||
auto* utility_layout = new QGridLayout();
|
||||
utility_box->setLayout(utility_layout);
|
||||
|
||||
m_load_custom_textures = new ConfigBool(tr("Load Custom Textures"), Config::GFX_HIRES_TEXTURES);
|
||||
m_prefetch_custom_textures =
|
||||
new ConfigBool(tr("Prefetch Custom Textures"), Config::GFX_CACHE_HIRES_TEXTURES);
|
||||
m_load_custom_textures =
|
||||
new ConfigBool(tr("Load Custom Textures"), Config::GFX_HIRES_TEXTURES, m_game_layer);
|
||||
m_prefetch_custom_textures = new ConfigBool(tr("Prefetch Custom Textures"),
|
||||
Config::GFX_CACHE_HIRES_TEXTURES, m_game_layer);
|
||||
m_prefetch_custom_textures->setEnabled(m_load_custom_textures->isChecked());
|
||||
m_dump_efb_target = new ConfigBool(tr("Dump EFB Target"), Config::GFX_DUMP_EFB_TARGET);
|
||||
m_dump_xfb_target = new ConfigBool(tr("Dump XFB Target"), Config::GFX_DUMP_XFB_TARGET);
|
||||
m_disable_vram_copies =
|
||||
new ConfigBool(tr("Disable EFB VRAM Copies"), Config::GFX_HACK_DISABLE_COPY_TO_VRAM);
|
||||
m_enable_graphics_mods = new ToolTipCheckBox(tr("Enable Graphics Mods"));
|
||||
|
||||
if (local_edit)
|
||||
{
|
||||
// It's hazardous to accidentally set these in a game ini.
|
||||
m_dump_efb_target->setEnabled(false);
|
||||
m_dump_xfb_target->setEnabled(false);
|
||||
}
|
||||
|
||||
m_disable_vram_copies = new ConfigBool(tr("Disable EFB VRAM Copies"),
|
||||
Config::GFX_HACK_DISABLE_COPY_TO_VRAM, m_game_layer);
|
||||
m_enable_graphics_mods =
|
||||
new ConfigBool(tr("Enable Graphics Mods"), Config::GFX_MODS_ENABLE, m_game_layer);
|
||||
|
||||
utility_layout->addWidget(m_load_custom_textures, 0, 0);
|
||||
utility_layout->addWidget(m_prefetch_custom_textures, 0, 1);
|
||||
|
@ -128,6 +154,16 @@ void AdvancedWidget::CreateWidgets()
|
|||
m_dump_textures = new ConfigBool(tr("Enable"), Config::GFX_DUMP_TEXTURES);
|
||||
m_dump_base_textures = new ConfigBool(tr("Dump Base Textures"), Config::GFX_DUMP_BASE_TEXTURES);
|
||||
m_dump_mip_textures = new ConfigBool(tr("Dump Mip Maps"), Config::GFX_DUMP_MIP_TEXTURES);
|
||||
m_dump_mip_textures->setEnabled(m_dump_textures->isChecked());
|
||||
m_dump_base_textures->setEnabled(m_dump_textures->isChecked());
|
||||
|
||||
if (local_edit)
|
||||
{
|
||||
// It's hazardous to accidentally set dumping in a game ini.
|
||||
m_dump_textures->setEnabled(false);
|
||||
m_dump_base_textures->setEnabled(false);
|
||||
m_dump_mip_textures->setEnabled(false);
|
||||
}
|
||||
|
||||
texture_dump_layout->addWidget(m_dump_textures, 0, 0);
|
||||
|
||||
|
@ -142,18 +178,22 @@ void AdvancedWidget::CreateWidgets()
|
|||
m_frame_dumps_resolution_type =
|
||||
new ConfigChoice({tr("Window Resolution"), tr("Aspect Ratio Corrected Internal Resolution"),
|
||||
tr("Raw Internal Resolution")},
|
||||
Config::GFX_FRAME_DUMPS_RESOLUTION_TYPE);
|
||||
m_dump_use_ffv1 = new ConfigBool(tr("Use Lossless Codec (FFV1)"), Config::GFX_USE_FFV1);
|
||||
m_dump_bitrate = new ConfigInteger(0, 1000000, Config::GFX_BITRATE_KBPS, 1000);
|
||||
m_png_compression_level = new ConfigInteger(0, 9, Config::GFX_PNG_COMPRESSION_LEVEL);
|
||||
|
||||
Config::GFX_FRAME_DUMPS_RESOLUTION_TYPE, m_game_layer);
|
||||
m_png_compression_level =
|
||||
new ConfigInteger(0, 9, Config::GFX_PNG_COMPRESSION_LEVEL, m_game_layer);
|
||||
dump_layout->addWidget(new QLabel(tr("Resolution Type:")), 0, 0);
|
||||
dump_layout->addWidget(m_frame_dumps_resolution_type, 0, 1);
|
||||
|
||||
#if defined(HAVE_FFMPEG)
|
||||
m_dump_use_ffv1 =
|
||||
new ConfigBool(tr("Use Lossless Codec (FFV1)"), Config::GFX_USE_FFV1, m_game_layer);
|
||||
m_dump_bitrate = new ConfigInteger(0, 1000000, Config::GFX_BITRATE_KBPS, m_game_layer, 1000);
|
||||
m_dump_bitrate->setEnabled(!m_dump_use_ffv1->isChecked());
|
||||
dump_layout->addWidget(m_dump_use_ffv1, 1, 0);
|
||||
dump_layout->addWidget(new QLabel(tr("Bitrate (kbps):")), 2, 0);
|
||||
dump_layout->addWidget(m_dump_bitrate, 2, 1);
|
||||
#endif
|
||||
|
||||
dump_layout->addWidget(new QLabel(tr("PNG Compression Level:")), 3, 0);
|
||||
m_png_compression_level->SetTitle(tr("PNG Compression Level"));
|
||||
dump_layout->addWidget(m_png_compression_level, 3, 1);
|
||||
|
@ -163,14 +203,16 @@ void AdvancedWidget::CreateWidgets()
|
|||
auto* misc_layout = new QGridLayout();
|
||||
misc_box->setLayout(misc_layout);
|
||||
|
||||
m_enable_cropping = new ConfigBool(tr("Crop"), Config::GFX_CROP);
|
||||
m_enable_prog_scan = new ToolTipCheckBox(tr("Enable Progressive Scan"));
|
||||
m_backend_multithreading =
|
||||
new ConfigBool(tr("Backend Multithreading"), Config::GFX_BACKEND_MULTITHREADING);
|
||||
m_enable_cropping = new ConfigBool(tr("Crop"), Config::GFX_CROP, m_game_layer);
|
||||
m_enable_prog_scan =
|
||||
new ConfigBool(tr("Enable Progressive Scan"), Config::SYSCONF_PROGRESSIVE_SCAN, m_game_layer);
|
||||
m_backend_multithreading = new ConfigBool(tr("Backend Multithreading"),
|
||||
Config::GFX_BACKEND_MULTITHREADING, m_game_layer);
|
||||
m_prefer_vs_for_point_line_expansion = new ConfigBool(
|
||||
// i18n: VS is short for vertex shaders.
|
||||
tr("Prefer VS for Point/Line Expansion"), Config::GFX_PREFER_VS_FOR_LINE_POINT_EXPANSION);
|
||||
m_cpu_cull = new ConfigBool(tr("Cull Vertices on the CPU"), Config::GFX_CPU_CULL);
|
||||
tr("Prefer VS for Point/Line Expansion"), Config::GFX_PREFER_VS_FOR_LINE_POINT_EXPANSION,
|
||||
m_game_layer);
|
||||
m_cpu_cull = new ConfigBool(tr("Cull Vertices on the CPU"), Config::GFX_CPU_CULL, m_game_layer);
|
||||
|
||||
misc_layout->addWidget(m_enable_cropping, 0, 0);
|
||||
misc_layout->addWidget(m_enable_prog_scan, 0, 1);
|
||||
|
@ -179,7 +221,7 @@ void AdvancedWidget::CreateWidgets()
|
|||
misc_layout->addWidget(m_cpu_cull, 2, 0);
|
||||
#ifdef _WIN32
|
||||
m_borderless_fullscreen =
|
||||
new ConfigBool(tr("Borderless Fullscreen"), Config::GFX_BORDERLESS_FULLSCREEN);
|
||||
new ConfigBool(tr("Borderless Fullscreen"), Config::GFX_BORDERLESS_FULLSCREEN, m_game_layer);
|
||||
|
||||
misc_layout->addWidget(m_borderless_fullscreen, 2, 1);
|
||||
#endif
|
||||
|
@ -189,10 +231,10 @@ void AdvancedWidget::CreateWidgets()
|
|||
auto* experimental_layout = new QGridLayout();
|
||||
experimental_box->setLayout(experimental_layout);
|
||||
|
||||
m_defer_efb_access_invalidation =
|
||||
new ConfigBool(tr("Defer EFB Cache Invalidation"), Config::GFX_HACK_EFB_DEFER_INVALIDATION);
|
||||
m_manual_texture_sampling =
|
||||
new ConfigBool(tr("Manual Texture Sampling"), Config::GFX_HACK_FAST_TEXTURE_SAMPLING, true);
|
||||
m_defer_efb_access_invalidation = new ConfigBool(
|
||||
tr("Defer EFB Cache Invalidation"), Config::GFX_HACK_EFB_DEFER_INVALIDATION, m_game_layer);
|
||||
m_manual_texture_sampling = new ConfigBool(
|
||||
tr("Manual Texture Sampling"), Config::GFX_HACK_FAST_TEXTURE_SAMPLING, m_game_layer, true);
|
||||
|
||||
experimental_layout->addWidget(m_defer_efb_access_invalidation, 0, 0);
|
||||
experimental_layout->addWidget(m_manual_texture_sampling, 0, 1);
|
||||
|
@ -211,34 +253,19 @@ void AdvancedWidget::CreateWidgets()
|
|||
|
||||
void AdvancedWidget::ConnectWidgets()
|
||||
{
|
||||
connect(m_load_custom_textures, &QCheckBox::toggled, this, &AdvancedWidget::SaveSettings);
|
||||
connect(m_dump_use_ffv1, &QCheckBox::toggled, this, &AdvancedWidget::SaveSettings);
|
||||
connect(m_enable_prog_scan, &QCheckBox::toggled, this, &AdvancedWidget::SaveSettings);
|
||||
connect(m_dump_textures, &QCheckBox::toggled, this, &AdvancedWidget::SaveSettings);
|
||||
connect(m_enable_graphics_mods, &QCheckBox::toggled, this, &AdvancedWidget::SaveSettings);
|
||||
}
|
||||
connect(m_load_custom_textures, &QCheckBox::toggled, this,
|
||||
[this](bool checked) { m_prefetch_custom_textures->setEnabled(checked); });
|
||||
connect(m_dump_textures, &QCheckBox::toggled, this, [this](bool checked) {
|
||||
m_dump_mip_textures->setEnabled(checked);
|
||||
m_dump_base_textures->setEnabled(checked);
|
||||
});
|
||||
connect(m_enable_graphics_mods, &QCheckBox::toggled, this,
|
||||
[this](bool checked) { emit Settings::Instance().EnableGfxModsChanged(checked); });
|
||||
|
||||
void AdvancedWidget::LoadSettings()
|
||||
{
|
||||
m_prefetch_custom_textures->setEnabled(Config::Get(Config::GFX_HIRES_TEXTURES));
|
||||
m_dump_bitrate->setEnabled(!Config::Get(Config::GFX_USE_FFV1));
|
||||
|
||||
m_enable_prog_scan->setChecked(Config::Get(Config::SYSCONF_PROGRESSIVE_SCAN));
|
||||
m_dump_mip_textures->setEnabled(Config::Get(Config::GFX_DUMP_TEXTURES));
|
||||
m_dump_base_textures->setEnabled(Config::Get(Config::GFX_DUMP_TEXTURES));
|
||||
|
||||
SignalBlocking(m_enable_graphics_mods)->setChecked(Settings::Instance().GetGraphicModsEnabled());
|
||||
}
|
||||
|
||||
void AdvancedWidget::SaveSettings()
|
||||
{
|
||||
m_prefetch_custom_textures->setEnabled(Config::Get(Config::GFX_HIRES_TEXTURES));
|
||||
m_dump_bitrate->setEnabled(!Config::Get(Config::GFX_USE_FFV1));
|
||||
|
||||
Config::SetBase(Config::SYSCONF_PROGRESSIVE_SCAN, m_enable_prog_scan->isChecked());
|
||||
m_dump_mip_textures->setEnabled(Config::Get(Config::GFX_DUMP_TEXTURES));
|
||||
m_dump_base_textures->setEnabled(Config::Get(Config::GFX_DUMP_TEXTURES));
|
||||
Settings::Instance().SetGraphicModsEnabled(m_enable_graphics_mods->isChecked());
|
||||
#if defined(HAVE_FFMPEG)
|
||||
connect(m_dump_use_ffv1, &QCheckBox::toggled, this,
|
||||
[this](bool checked) { m_dump_bitrate->setEnabled(!checked); });
|
||||
#endif
|
||||
}
|
||||
|
||||
void AdvancedWidget::OnBackendChanged()
|
||||
|
|
|
@ -8,22 +8,22 @@
|
|||
class ConfigBool;
|
||||
class ConfigChoice;
|
||||
class ConfigInteger;
|
||||
class GameConfigWidget;
|
||||
class GraphicsWindow;
|
||||
class QCheckBox;
|
||||
class QComboBox;
|
||||
class QSpinBox;
|
||||
class ToolTipCheckBox;
|
||||
|
||||
namespace Config
|
||||
{
|
||||
class Layer;
|
||||
} // namespace Config
|
||||
|
||||
class AdvancedWidget final : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit AdvancedWidget(GraphicsWindow* parent);
|
||||
AdvancedWidget(GameConfigWidget* parent, Config::Layer* layer);
|
||||
|
||||
private:
|
||||
void LoadSettings();
|
||||
void SaveSettings();
|
||||
|
||||
void CreateWidgets();
|
||||
void ConnectWidgets();
|
||||
void AddDescriptions();
|
||||
|
@ -52,7 +52,7 @@ private:
|
|||
ConfigBool* m_dump_xfb_target;
|
||||
ConfigBool* m_disable_vram_copies;
|
||||
ConfigBool* m_load_custom_textures;
|
||||
ToolTipCheckBox* m_enable_graphics_mods;
|
||||
ConfigBool* m_enable_graphics_mods;
|
||||
|
||||
// Texture dumping
|
||||
ConfigBool* m_dump_textures;
|
||||
|
@ -67,7 +67,7 @@ private:
|
|||
|
||||
// Misc
|
||||
ConfigBool* m_enable_cropping;
|
||||
ToolTipCheckBox* m_enable_prog_scan;
|
||||
ConfigBool* m_enable_prog_scan;
|
||||
ConfigBool* m_backend_multithreading;
|
||||
ConfigBool* m_prefer_vs_for_point_line_expansion;
|
||||
ConfigBool* m_cpu_cull;
|
||||
|
@ -76,4 +76,6 @@ private:
|
|||
// Experimental
|
||||
ConfigBool* m_defer_efb_access_invalidation;
|
||||
ConfigBool* m_manual_texture_sampling;
|
||||
|
||||
Config::Layer* m_game_layer = nullptr;
|
||||
};
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
#include <QPushButton>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
|
||||
#include "Core/Config/GraphicsSettings.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
|
||||
|
@ -18,6 +20,7 @@
|
|||
#include "DolphinQt/Config/ConfigControls/ConfigChoice.h"
|
||||
#include "DolphinQt/Config/ConfigControls/ConfigRadio.h"
|
||||
#include "DolphinQt/Config/ConfigControls/ConfigSlider.h"
|
||||
#include "DolphinQt/Config/GameConfigWidget.h"
|
||||
#include "DolphinQt/Config/Graphics/ColorCorrectionConfigWindow.h"
|
||||
#include "DolphinQt/Config/Graphics/GraphicsWindow.h"
|
||||
#include "DolphinQt/Config/Graphics/PostProcessingConfigWindow.h"
|
||||
|
@ -31,31 +34,43 @@
|
|||
#include "VideoCommon/VideoCommon.h"
|
||||
#include "VideoCommon/VideoConfig.h"
|
||||
|
||||
EnhancementsWidget::EnhancementsWidget(GraphicsWindow* parent) : m_block_save(false)
|
||||
EnhancementsWidget::EnhancementsWidget(GraphicsWindow* parent)
|
||||
{
|
||||
CreateWidgets();
|
||||
LoadSettings();
|
||||
LoadPPShaders();
|
||||
ConnectWidgets();
|
||||
AddDescriptions();
|
||||
connect(parent, &GraphicsWindow::BackendChanged,
|
||||
[this](const QString& backend) { LoadSettings(); });
|
||||
connect(parent, &GraphicsWindow::UseFastTextureSamplingChanged, this,
|
||||
&EnhancementsWidget::LoadSettings);
|
||||
connect(parent, &GraphicsWindow::UseGPUTextureDecodingChanged, this,
|
||||
&EnhancementsWidget::LoadSettings);
|
||||
|
||||
// BackendChanged is called by parent on window creation.
|
||||
connect(parent, &GraphicsWindow::BackendChanged, this, &EnhancementsWidget::OnBackendChanged);
|
||||
connect(parent, &GraphicsWindow::UseFastTextureSamplingChanged, this, [this]() {
|
||||
m_texture_filtering_combo->setEnabled(ReadSetting(Config::GFX_HACK_FAST_TEXTURE_SAMPLING));
|
||||
});
|
||||
connect(parent, &GraphicsWindow::UseGPUTextureDecodingChanged, this, [this]() {
|
||||
m_arbitrary_mipmap_detection->setEnabled(!ReadSetting(Config::GFX_ENABLE_GPU_TEXTURE_DECODING));
|
||||
});
|
||||
}
|
||||
|
||||
constexpr int TEXTURE_FILTERING_DEFAULT = 0;
|
||||
constexpr int TEXTURE_FILTERING_ANISO_2X = 1;
|
||||
constexpr int TEXTURE_FILTERING_ANISO_4X = 2;
|
||||
constexpr int TEXTURE_FILTERING_ANISO_8X = 3;
|
||||
constexpr int TEXTURE_FILTERING_ANISO_16X = 4;
|
||||
constexpr int TEXTURE_FILTERING_FORCE_NEAREST = 5;
|
||||
constexpr int TEXTURE_FILTERING_FORCE_LINEAR = 6;
|
||||
constexpr int TEXTURE_FILTERING_FORCE_LINEAR_ANISO_2X = 7;
|
||||
constexpr int TEXTURE_FILTERING_FORCE_LINEAR_ANISO_4X = 8;
|
||||
constexpr int TEXTURE_FILTERING_FORCE_LINEAR_ANISO_8X = 9;
|
||||
constexpr int TEXTURE_FILTERING_FORCE_LINEAR_ANISO_16X = 10;
|
||||
EnhancementsWidget::EnhancementsWidget(GameConfigWidget* parent, Config::Layer* layer)
|
||||
: m_game_layer(layer)
|
||||
{
|
||||
CreateWidgets();
|
||||
LoadPPShaders();
|
||||
ConnectWidgets();
|
||||
AddDescriptions();
|
||||
|
||||
connect(&Settings::Instance(), &Settings::ConfigChanged, this,
|
||||
&EnhancementsWidget::OnConfigChanged);
|
||||
}
|
||||
|
||||
constexpr int ANISO_DEFAULT = 0;
|
||||
constexpr int ANISO_2X = 1;
|
||||
constexpr int ANISO_4X = 2;
|
||||
constexpr int ANISO_8X = 3;
|
||||
constexpr int ANISO_16X = 4;
|
||||
constexpr int FILTERING_DEFAULT = 0;
|
||||
constexpr int FILTERING_NEAREST = 1;
|
||||
constexpr int FILTERING_LINEAR = 2;
|
||||
|
||||
void EnhancementsWidget::CreateWidgets()
|
||||
{
|
||||
|
@ -83,7 +98,7 @@ void EnhancementsWidget::CreateWidgets()
|
|||
// If the current scale is greater than the max scale in the ini, add sufficient options so that
|
||||
// when the settings are saved we don't lose the user-modified value from the ini.
|
||||
const int max_efb_scale =
|
||||
std::max(Config::Get(Config::GFX_EFB_SCALE), Config::Get(Config::GFX_MAX_EFB_SCALE));
|
||||
std::max(ReadSetting(Config::GFX_EFB_SCALE), ReadSetting(Config::GFX_MAX_EFB_SCALE));
|
||||
for (int scale = static_cast<int>(resolution_options.size()); scale <= max_efb_scale; scale++)
|
||||
{
|
||||
const QString scale_text = QString::number(scale);
|
||||
|
@ -104,61 +119,60 @@ void EnhancementsWidget::CreateWidgets()
|
|||
}
|
||||
}
|
||||
|
||||
m_ir_combo = new ConfigChoice(resolution_options, Config::GFX_EFB_SCALE);
|
||||
m_ir_combo = new ConfigChoice(resolution_options, Config::GFX_EFB_SCALE, m_game_layer);
|
||||
m_ir_combo->setMaxVisibleItems(visible_resolution_option_count);
|
||||
|
||||
m_aa_combo = new ToolTipComboBox();
|
||||
m_aa_combo = new ConfigComplexChoice(Config::GFX_MSAA, Config::GFX_SSAA, m_game_layer);
|
||||
m_aa_combo->Add(tr("None"), (u32)1, false);
|
||||
|
||||
m_texture_filtering_combo = new ToolTipComboBox();
|
||||
m_texture_filtering_combo->addItem(tr("Default"), TEXTURE_FILTERING_DEFAULT);
|
||||
m_texture_filtering_combo->addItem(tr("2x Anisotropic"), TEXTURE_FILTERING_ANISO_2X);
|
||||
m_texture_filtering_combo->addItem(tr("4x Anisotropic"), TEXTURE_FILTERING_ANISO_4X);
|
||||
m_texture_filtering_combo->addItem(tr("8x Anisotropic"), TEXTURE_FILTERING_ANISO_8X);
|
||||
m_texture_filtering_combo->addItem(tr("16x Anisotropic"), TEXTURE_FILTERING_ANISO_16X);
|
||||
m_texture_filtering_combo->addItem(tr("Force Nearest"), TEXTURE_FILTERING_FORCE_NEAREST);
|
||||
m_texture_filtering_combo->addItem(tr("Force Linear"), TEXTURE_FILTERING_FORCE_LINEAR);
|
||||
m_texture_filtering_combo->addItem(tr("Force Linear and 2x Anisotropic"),
|
||||
TEXTURE_FILTERING_FORCE_LINEAR_ANISO_2X);
|
||||
m_texture_filtering_combo->addItem(tr("Force Linear and 4x Anisotropic"),
|
||||
TEXTURE_FILTERING_FORCE_LINEAR_ANISO_4X);
|
||||
m_texture_filtering_combo->addItem(tr("Force Linear and 8x Anisotropic"),
|
||||
TEXTURE_FILTERING_FORCE_LINEAR_ANISO_8X);
|
||||
m_texture_filtering_combo->addItem(tr("Force Linear and 16x Anisotropic"),
|
||||
TEXTURE_FILTERING_FORCE_LINEAR_ANISO_16X);
|
||||
m_texture_filtering_combo =
|
||||
new ConfigComplexChoice(Config::GFX_ENHANCE_MAX_ANISOTROPY,
|
||||
Config::GFX_ENHANCE_FORCE_TEXTURE_FILTERING, m_game_layer);
|
||||
|
||||
m_output_resampling_combo = new ToolTipComboBox();
|
||||
m_output_resampling_combo->addItem(tr("Default"),
|
||||
static_cast<int>(OutputResamplingMode::Default));
|
||||
m_output_resampling_combo->addItem(tr("Bilinear"),
|
||||
static_cast<int>(OutputResamplingMode::Bilinear));
|
||||
m_output_resampling_combo->addItem(tr("Bicubic: B-Spline"),
|
||||
static_cast<int>(OutputResamplingMode::BSpline));
|
||||
m_output_resampling_combo->addItem(tr("Bicubic: Mitchell-Netravali"),
|
||||
static_cast<int>(OutputResamplingMode::MitchellNetravali));
|
||||
m_output_resampling_combo->addItem(tr("Bicubic: Catmull-Rom"),
|
||||
static_cast<int>(OutputResamplingMode::CatmullRom));
|
||||
m_output_resampling_combo->addItem(tr("Sharp Bilinear"),
|
||||
static_cast<int>(OutputResamplingMode::SharpBilinear));
|
||||
m_output_resampling_combo->addItem(tr("Area Sampling"),
|
||||
static_cast<int>(OutputResamplingMode::AreaSampling));
|
||||
m_texture_filtering_combo->Add(tr("Default"), ANISO_DEFAULT, FILTERING_DEFAULT);
|
||||
m_texture_filtering_combo->Add(tr("2x Anisotropic"), ANISO_2X, FILTERING_DEFAULT);
|
||||
m_texture_filtering_combo->Add(tr("4x Anisotropic"), ANISO_4X, FILTERING_DEFAULT);
|
||||
m_texture_filtering_combo->Add(tr("8x Anisotropic"), ANISO_8X, FILTERING_DEFAULT);
|
||||
m_texture_filtering_combo->Add(tr("16x Anisotropic"), ANISO_16X, FILTERING_DEFAULT);
|
||||
m_texture_filtering_combo->Add(tr("Force Nearest"), ANISO_DEFAULT, FILTERING_NEAREST);
|
||||
m_texture_filtering_combo->Add(tr("Force Linear"), ANISO_DEFAULT, FILTERING_LINEAR);
|
||||
m_texture_filtering_combo->Add(tr("Force Linear and 2x Anisotropic"), ANISO_2X, FILTERING_LINEAR);
|
||||
m_texture_filtering_combo->Add(tr("Force Linear and 4x Anisotropic"), ANISO_4X, FILTERING_LINEAR);
|
||||
m_texture_filtering_combo->Add(tr("Force Linear and 8x Anisotropic"), ANISO_8X, FILTERING_LINEAR);
|
||||
m_texture_filtering_combo->Add(tr("Force Linear and 16x Anisotropic"), ANISO_16X,
|
||||
FILTERING_LINEAR);
|
||||
m_texture_filtering_combo->Refresh();
|
||||
m_texture_filtering_combo->setEnabled(ReadSetting(Config::GFX_HACK_FAST_TEXTURE_SAMPLING));
|
||||
|
||||
m_output_resampling_combo = new ConfigChoice(
|
||||
{tr("Default"), tr("Bilinear"), tr("Bicubic: B-Spline"), tr("Bicubic: Mitchell-Netravali"),
|
||||
tr("Bicubic: Catmull-Rom"), tr("Sharp Bilinear"), tr("Area Sampling")},
|
||||
Config::GFX_ENHANCE_OUTPUT_RESAMPLING, m_game_layer);
|
||||
|
||||
m_configure_color_correction = new ToolTipPushButton(tr("Configure"));
|
||||
|
||||
m_pp_effect = new ToolTipComboBox();
|
||||
m_pp_effect = new ConfigStringChoice(VideoCommon::PostProcessing::GetShaderList(),
|
||||
Config::GFX_ENHANCE_POST_SHADER, m_game_layer);
|
||||
m_configure_pp_effect = new NonDefaultQPushButton(tr("Configure"));
|
||||
m_scaled_efb_copy = new ConfigBool(tr("Scaled EFB Copy"), Config::GFX_HACK_COPY_EFB_SCALED);
|
||||
m_per_pixel_lighting =
|
||||
new ConfigBool(tr("Per-Pixel Lighting"), Config::GFX_ENABLE_PIXEL_LIGHTING);
|
||||
m_configure_pp_effect->setDisabled(true);
|
||||
|
||||
m_widescreen_hack = new ConfigBool(tr("Widescreen Hack"), Config::GFX_WIDESCREEN_HACK);
|
||||
m_disable_fog = new ConfigBool(tr("Disable Fog"), Config::GFX_DISABLE_FOG);
|
||||
m_scaled_efb_copy =
|
||||
new ConfigBool(tr("Scaled EFB Copy"), Config::GFX_HACK_COPY_EFB_SCALED, m_game_layer);
|
||||
m_per_pixel_lighting =
|
||||
new ConfigBool(tr("Per-Pixel Lighting"), Config::GFX_ENABLE_PIXEL_LIGHTING, m_game_layer);
|
||||
|
||||
m_widescreen_hack =
|
||||
new ConfigBool(tr("Widescreen Hack"), Config::GFX_WIDESCREEN_HACK, m_game_layer);
|
||||
m_disable_fog = new ConfigBool(tr("Disable Fog"), Config::GFX_DISABLE_FOG, m_game_layer);
|
||||
m_force_24bit_color =
|
||||
new ConfigBool(tr("Force 24-Bit Color"), Config::GFX_ENHANCE_FORCE_TRUE_COLOR);
|
||||
m_disable_copy_filter =
|
||||
new ConfigBool(tr("Disable Copy Filter"), Config::GFX_ENHANCE_DISABLE_COPY_FILTER);
|
||||
m_arbitrary_mipmap_detection = new ConfigBool(tr("Arbitrary Mipmap Detection"),
|
||||
Config::GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION);
|
||||
m_hdr = new ConfigBool(tr("HDR Post-Processing"), Config::GFX_ENHANCE_HDR_OUTPUT);
|
||||
new ConfigBool(tr("Force 24-Bit Color"), Config::GFX_ENHANCE_FORCE_TRUE_COLOR, m_game_layer);
|
||||
m_disable_copy_filter = new ConfigBool(tr("Disable Copy Filter"),
|
||||
Config::GFX_ENHANCE_DISABLE_COPY_FILTER, m_game_layer);
|
||||
m_arbitrary_mipmap_detection =
|
||||
new ConfigBool(tr("Arbitrary Mipmap Detection"),
|
||||
Config::GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION, m_game_layer);
|
||||
m_arbitrary_mipmap_detection->setEnabled(!ReadSetting(Config::GFX_ENABLE_GPU_TEXTURE_DECODING));
|
||||
m_hdr = new ConfigBool(tr("HDR Post-Processing"), Config::GFX_ENHANCE_HDR_OUTPUT, m_game_layer);
|
||||
|
||||
int row = 0;
|
||||
enhancements_layout->addWidget(new QLabel(tr("Internal Resolution:")), row, 0);
|
||||
|
@ -209,26 +223,27 @@ void EnhancementsWidget::CreateWidgets()
|
|||
|
||||
m_3d_mode = new ConfigChoice({tr("Off"), tr("Side-by-Side"), tr("Top-and-Bottom"), tr("Anaglyph"),
|
||||
tr("HDMI 3D"), tr("Passive")},
|
||||
Config::GFX_STEREO_MODE);
|
||||
m_3d_depth = new ConfigSlider(0, Config::GFX_STEREO_DEPTH_MAXIMUM, Config::GFX_STEREO_DEPTH);
|
||||
Config::GFX_STEREO_MODE, m_game_layer);
|
||||
m_3d_depth =
|
||||
new ConfigSlider(0, Config::GFX_STEREO_DEPTH_MAXIMUM, Config::GFX_STEREO_DEPTH, m_game_layer);
|
||||
m_3d_convergence = new ConfigSlider(0, Config::GFX_STEREO_CONVERGENCE_MAXIMUM,
|
||||
Config::GFX_STEREO_CONVERGENCE, 100);
|
||||
Config::GFX_STEREO_CONVERGENCE, m_game_layer, 100);
|
||||
|
||||
m_3d_swap_eyes = new ConfigBool(tr("Swap Eyes"), Config::GFX_STEREO_SWAP_EYES);
|
||||
m_3d_swap_eyes = new ConfigBool(tr("Swap Eyes"), Config::GFX_STEREO_SWAP_EYES, m_game_layer);
|
||||
|
||||
m_3d_per_eye_resolution =
|
||||
new ConfigBool(tr("Use Full Resolution Per Eye"), Config::GFX_STEREO_PER_EYE_RESOLUTION_FULL);
|
||||
m_3d_per_eye_resolution = new ConfigBool(
|
||||
tr("Use Full Resolution Per Eye"), Config::GFX_STEREO_PER_EYE_RESOLUTION_FULL, m_game_layer);
|
||||
|
||||
stereoscopy_layout->addWidget(new QLabel(tr("Stereoscopic 3D Mode:")), 0, 0);
|
||||
stereoscopy_layout->addWidget(m_3d_mode, 0, 1);
|
||||
stereoscopy_layout->addWidget(new QLabel(tr("Depth:")), 1, 0);
|
||||
stereoscopy_layout->addWidget(new ConfigSliderLabel(tr("Depth:"), m_3d_depth), 1, 0);
|
||||
stereoscopy_layout->addWidget(m_3d_depth, 1, 1);
|
||||
stereoscopy_layout->addWidget(new QLabel(tr("Convergence:")), 2, 0);
|
||||
stereoscopy_layout->addWidget(new ConfigSliderLabel(tr("Convergence:"), m_3d_convergence), 2, 0);
|
||||
stereoscopy_layout->addWidget(m_3d_convergence, 2, 1);
|
||||
stereoscopy_layout->addWidget(m_3d_swap_eyes, 3, 0);
|
||||
stereoscopy_layout->addWidget(m_3d_per_eye_resolution, 4, 0);
|
||||
|
||||
auto current_stereo_mode = Config::Get(Config::GFX_STEREO_MODE);
|
||||
auto current_stereo_mode = ReadSetting(Config::GFX_STEREO_MODE);
|
||||
if (current_stereo_mode != StereoMode::SBS && current_stereo_mode != StereoMode::TAB)
|
||||
m_3d_per_eye_resolution->hide();
|
||||
|
||||
|
@ -241,58 +256,53 @@ void EnhancementsWidget::CreateWidgets()
|
|||
|
||||
void EnhancementsWidget::ConnectWidgets()
|
||||
{
|
||||
connect(m_aa_combo, &QComboBox::currentIndexChanged, [this](int) { SaveSettings(); });
|
||||
connect(m_texture_filtering_combo, &QComboBox::currentIndexChanged,
|
||||
[this](int) { SaveSettings(); });
|
||||
connect(m_output_resampling_combo, &QComboBox::currentIndexChanged,
|
||||
[this](int) { SaveSettings(); });
|
||||
connect(m_pp_effect, &QComboBox::currentIndexChanged, [this](int) { SaveSettings(); });
|
||||
connect(m_3d_mode, &QComboBox::currentIndexChanged, [this] {
|
||||
m_block_save = true;
|
||||
m_configure_color_correction->setEnabled(g_Config.backend_info.bSupportsPostProcessing);
|
||||
|
||||
auto current_stereo_mode = Config::Get(Config::GFX_STEREO_MODE);
|
||||
LoadPPShaders(current_stereo_mode);
|
||||
auto current_stereo_mode = ReadSetting(Config::GFX_STEREO_MODE);
|
||||
LoadPPShaders();
|
||||
|
||||
if (current_stereo_mode == StereoMode::SBS || current_stereo_mode == StereoMode::TAB)
|
||||
m_3d_per_eye_resolution->show();
|
||||
else
|
||||
m_3d_per_eye_resolution->hide();
|
||||
|
||||
m_block_save = false;
|
||||
SaveSettings();
|
||||
});
|
||||
|
||||
connect(m_pp_effect, &QComboBox::currentIndexChanged, this, &EnhancementsWidget::ShaderChanged);
|
||||
|
||||
connect(m_configure_color_correction, &QPushButton::clicked, this,
|
||||
&EnhancementsWidget::ConfigureColorCorrection);
|
||||
connect(m_configure_pp_effect, &QPushButton::clicked, this,
|
||||
&EnhancementsWidget::ConfigurePostProcessingShader);
|
||||
|
||||
connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this] {
|
||||
const QSignalBlocker blocker(this);
|
||||
m_block_save = true;
|
||||
LoadPPShaders(Config::Get(Config::GFX_STEREO_MODE));
|
||||
m_block_save = false;
|
||||
});
|
||||
}
|
||||
|
||||
void EnhancementsWidget::LoadPPShaders(StereoMode stereo_mode)
|
||||
template <typename T>
|
||||
T EnhancementsWidget::ReadSetting(const Config::Info<T>& setting) const
|
||||
{
|
||||
std::vector<std::string> shaders = VideoCommon::PostProcessing::GetShaderList();
|
||||
if (stereo_mode == StereoMode::Anaglyph)
|
||||
{
|
||||
shaders = VideoCommon::PostProcessing::GetAnaglyphShaderList();
|
||||
}
|
||||
else if (stereo_mode == StereoMode::Passive)
|
||||
{
|
||||
shaders = VideoCommon::PostProcessing::GetPassiveShaderList();
|
||||
}
|
||||
if (m_game_layer != nullptr)
|
||||
return m_game_layer->Get(setting);
|
||||
else
|
||||
return Config::Get(setting);
|
||||
}
|
||||
|
||||
void EnhancementsWidget::LoadPPShaders()
|
||||
{
|
||||
auto stereo_mode = ReadSetting(Config::GFX_STEREO_MODE);
|
||||
|
||||
const QSignalBlocker blocker(m_pp_effect);
|
||||
m_pp_effect->clear();
|
||||
|
||||
// Get shader list
|
||||
std::vector<std::string> shaders = VideoCommon::PostProcessing::GetShaderList();
|
||||
|
||||
if (stereo_mode == StereoMode::Anaglyph)
|
||||
shaders = VideoCommon::PostProcessing::GetAnaglyphShaderList();
|
||||
else if (stereo_mode == StereoMode::Passive)
|
||||
shaders = VideoCommon::PostProcessing::GetPassiveShaderList();
|
||||
|
||||
// Populate widget
|
||||
if (stereo_mode != StereoMode::Anaglyph && stereo_mode != StereoMode::Passive)
|
||||
m_pp_effect->addItem(tr("(off)"));
|
||||
|
||||
auto selected_shader = Config::Get(Config::GFX_ENHANCE_POST_SHADER);
|
||||
auto selected_shader = ReadSetting(Config::GFX_ENHANCE_POST_SHADER);
|
||||
|
||||
bool found = false;
|
||||
|
||||
|
@ -306,6 +316,7 @@ void EnhancementsWidget::LoadPPShaders(StereoMode stereo_mode)
|
|||
}
|
||||
}
|
||||
|
||||
// Force a shader for StereoModes that require it.
|
||||
if (!found)
|
||||
{
|
||||
if (stereo_mode == StereoMode::Anaglyph)
|
||||
|
@ -321,103 +332,20 @@ void EnhancementsWidget::LoadPPShaders(StereoMode stereo_mode)
|
|||
else
|
||||
m_pp_effect->setCurrentIndex(0);
|
||||
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_POST_SHADER, selected_shader);
|
||||
// Save forced shader, but avoid forcing an option into a game ini layer.
|
||||
if (m_game_layer == nullptr && ReadSetting(Config::GFX_ENHANCE_POST_SHADER) != selected_shader)
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_POST_SHADER, selected_shader);
|
||||
}
|
||||
|
||||
const bool supports_postprocessing = g_Config.backend_info.bSupportsPostProcessing;
|
||||
m_pp_effect->setEnabled(supports_postprocessing);
|
||||
|
||||
m_pp_effect->setToolTip(supports_postprocessing ?
|
||||
QString{} :
|
||||
tr("%1 doesn't support this feature.")
|
||||
.arg(tr(g_video_backend->GetDisplayName().c_str())));
|
||||
|
||||
VideoCommon::PostProcessingConfiguration pp_shader;
|
||||
if (selected_shader != "" && supports_postprocessing)
|
||||
{
|
||||
pp_shader.LoadShader(selected_shader);
|
||||
m_configure_pp_effect->setEnabled(pp_shader.HasOptions());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_configure_pp_effect->setEnabled(false);
|
||||
}
|
||||
m_pp_effect->Load();
|
||||
ShaderChanged();
|
||||
}
|
||||
|
||||
void EnhancementsWidget::LoadSettings()
|
||||
void EnhancementsWidget::OnBackendChanged()
|
||||
{
|
||||
m_block_save = true;
|
||||
m_texture_filtering_combo->setEnabled(Config::Get(Config::GFX_HACK_FAST_TEXTURE_SAMPLING));
|
||||
m_arbitrary_mipmap_detection->setEnabled(!Config::Get(Config::GFX_ENABLE_GPU_TEXTURE_DECODING));
|
||||
|
||||
// Anti-Aliasing
|
||||
|
||||
const u32 aa_selection = Config::Get(Config::GFX_MSAA);
|
||||
const bool ssaa = Config::Get(Config::GFX_SSAA);
|
||||
const int aniso = Config::Get(Config::GFX_ENHANCE_MAX_ANISOTROPY);
|
||||
const TextureFilteringMode tex_filter_mode =
|
||||
Config::Get(Config::GFX_ENHANCE_FORCE_TEXTURE_FILTERING);
|
||||
|
||||
m_aa_combo->clear();
|
||||
|
||||
for (const u32 aa_mode : g_Config.backend_info.AAModes)
|
||||
{
|
||||
if (aa_mode == 1)
|
||||
m_aa_combo->addItem(tr("None"), 1);
|
||||
else
|
||||
m_aa_combo->addItem(tr("%1x MSAA").arg(aa_mode), static_cast<int>(aa_mode));
|
||||
|
||||
if (aa_mode == aa_selection && !ssaa)
|
||||
m_aa_combo->setCurrentIndex(m_aa_combo->count() - 1);
|
||||
}
|
||||
if (g_Config.backend_info.bSupportsSSAA)
|
||||
{
|
||||
for (const u32 aa_mode : g_Config.backend_info.AAModes)
|
||||
{
|
||||
if (aa_mode != 1) // don't show "None" twice
|
||||
{
|
||||
// Mark SSAA using negative values in the variant
|
||||
m_aa_combo->addItem(tr("%1x SSAA").arg(aa_mode), -static_cast<int>(aa_mode));
|
||||
if (aa_mode == aa_selection && ssaa)
|
||||
m_aa_combo->setCurrentIndex(m_aa_combo->count() - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_aa_combo->setEnabled(m_aa_combo->count() > 1);
|
||||
|
||||
switch (tex_filter_mode)
|
||||
{
|
||||
case TextureFilteringMode::Default:
|
||||
if (aniso >= 0 && aniso <= 4)
|
||||
m_texture_filtering_combo->setCurrentIndex(aniso);
|
||||
else
|
||||
m_texture_filtering_combo->setCurrentIndex(TEXTURE_FILTERING_DEFAULT);
|
||||
break;
|
||||
case TextureFilteringMode::Nearest:
|
||||
m_texture_filtering_combo->setCurrentIndex(TEXTURE_FILTERING_FORCE_NEAREST);
|
||||
break;
|
||||
case TextureFilteringMode::Linear:
|
||||
if (aniso >= 0 && aniso <= 4)
|
||||
m_texture_filtering_combo->setCurrentIndex(TEXTURE_FILTERING_FORCE_LINEAR + aniso);
|
||||
else
|
||||
m_texture_filtering_combo->setCurrentIndex(TEXTURE_FILTERING_FORCE_LINEAR);
|
||||
break;
|
||||
}
|
||||
|
||||
// Resampling
|
||||
const OutputResamplingMode output_resampling_mode =
|
||||
Config::Get(Config::GFX_ENHANCE_OUTPUT_RESAMPLING);
|
||||
m_output_resampling_combo->setCurrentIndex(
|
||||
m_output_resampling_combo->findData(static_cast<int>(output_resampling_mode)));
|
||||
|
||||
m_output_resampling_combo->setEnabled(g_Config.backend_info.bSupportsPostProcessing);
|
||||
|
||||
// Color Correction
|
||||
m_configure_color_correction->setEnabled(g_Config.backend_info.bSupportsPostProcessing);
|
||||
|
||||
// Post Processing Shader
|
||||
LoadPPShaders(Config::Get(Config::GFX_STEREO_MODE));
|
||||
m_hdr->setEnabled(g_Config.backend_info.bSupportsHDROutput);
|
||||
|
||||
// Stereoscopy
|
||||
const bool supports_stereoscopy = g_Config.backend_info.bSupportsGeometryShaders;
|
||||
|
@ -426,105 +354,98 @@ void EnhancementsWidget::LoadSettings()
|
|||
m_3d_depth->setEnabled(supports_stereoscopy);
|
||||
m_3d_swap_eyes->setEnabled(supports_stereoscopy);
|
||||
|
||||
m_hdr->setEnabled(g_Config.backend_info.bSupportsHDROutput);
|
||||
|
||||
m_block_save = false;
|
||||
}
|
||||
|
||||
void EnhancementsWidget::SaveSettings()
|
||||
{
|
||||
if (m_block_save)
|
||||
return;
|
||||
|
||||
const u32 aa_value = static_cast<u32>(std::abs(m_aa_combo->currentData().toInt()));
|
||||
const bool is_ssaa = m_aa_combo->currentData().toInt() < 0;
|
||||
|
||||
Config::SetBaseOrCurrent(Config::GFX_MSAA, aa_value);
|
||||
Config::SetBaseOrCurrent(Config::GFX_SSAA, is_ssaa);
|
||||
|
||||
const int texture_filtering_selection = m_texture_filtering_combo->currentData().toInt();
|
||||
switch (texture_filtering_selection)
|
||||
// PostProcessing
|
||||
const bool supports_postprocessing = g_Config.backend_info.bSupportsPostProcessing;
|
||||
if (!supports_postprocessing)
|
||||
{
|
||||
case TEXTURE_FILTERING_DEFAULT:
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_MAX_ANISOTROPY, 0);
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_FORCE_TEXTURE_FILTERING,
|
||||
TextureFilteringMode::Default);
|
||||
break;
|
||||
case TEXTURE_FILTERING_ANISO_2X:
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_MAX_ANISOTROPY, 1);
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_FORCE_TEXTURE_FILTERING,
|
||||
TextureFilteringMode::Default);
|
||||
break;
|
||||
case TEXTURE_FILTERING_ANISO_4X:
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_MAX_ANISOTROPY, 2);
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_FORCE_TEXTURE_FILTERING,
|
||||
TextureFilteringMode::Default);
|
||||
break;
|
||||
case TEXTURE_FILTERING_ANISO_8X:
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_MAX_ANISOTROPY, 3);
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_FORCE_TEXTURE_FILTERING,
|
||||
TextureFilteringMode::Default);
|
||||
break;
|
||||
case TEXTURE_FILTERING_ANISO_16X:
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_MAX_ANISOTROPY, 4);
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_FORCE_TEXTURE_FILTERING,
|
||||
TextureFilteringMode::Default);
|
||||
break;
|
||||
case TEXTURE_FILTERING_FORCE_NEAREST:
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_MAX_ANISOTROPY, 0);
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_FORCE_TEXTURE_FILTERING,
|
||||
TextureFilteringMode::Nearest);
|
||||
break;
|
||||
case TEXTURE_FILTERING_FORCE_LINEAR:
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_MAX_ANISOTROPY, 0);
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_FORCE_TEXTURE_FILTERING,
|
||||
TextureFilteringMode::Linear);
|
||||
break;
|
||||
case TEXTURE_FILTERING_FORCE_LINEAR_ANISO_2X:
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_MAX_ANISOTROPY, 1);
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_FORCE_TEXTURE_FILTERING,
|
||||
TextureFilteringMode::Linear);
|
||||
break;
|
||||
case TEXTURE_FILTERING_FORCE_LINEAR_ANISO_4X:
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_MAX_ANISOTROPY, 2);
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_FORCE_TEXTURE_FILTERING,
|
||||
TextureFilteringMode::Linear);
|
||||
break;
|
||||
case TEXTURE_FILTERING_FORCE_LINEAR_ANISO_8X:
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_MAX_ANISOTROPY, 3);
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_FORCE_TEXTURE_FILTERING,
|
||||
TextureFilteringMode::Linear);
|
||||
break;
|
||||
case TEXTURE_FILTERING_FORCE_LINEAR_ANISO_16X:
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_MAX_ANISOTROPY, 4);
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_FORCE_TEXTURE_FILTERING,
|
||||
TextureFilteringMode::Linear);
|
||||
break;
|
||||
m_configure_pp_effect->setEnabled(false);
|
||||
m_pp_effect->setEnabled(false);
|
||||
m_pp_effect->setToolTip(
|
||||
tr("%1 doesn't support this feature.").arg(tr(g_video_backend->GetDisplayName().c_str())));
|
||||
}
|
||||
else if (!m_pp_effect->isEnabled() && supports_postprocessing)
|
||||
{
|
||||
m_configure_pp_effect->setEnabled(true);
|
||||
m_pp_effect->setEnabled(true);
|
||||
m_pp_effect->setToolTip(QString{});
|
||||
LoadPPShaders();
|
||||
}
|
||||
|
||||
const int output_resampling_selection = m_output_resampling_combo->currentData().toInt();
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_OUTPUT_RESAMPLING,
|
||||
static_cast<OutputResamplingMode>(output_resampling_selection));
|
||||
UpdateAAOptions();
|
||||
}
|
||||
|
||||
const bool anaglyph = g_Config.stereo_mode == StereoMode::Anaglyph;
|
||||
const bool passive = g_Config.stereo_mode == StereoMode::Passive;
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_POST_SHADER,
|
||||
(!anaglyph && !passive && m_pp_effect->currentIndex() == 0) ?
|
||||
"" :
|
||||
m_pp_effect->currentText().toStdString());
|
||||
void EnhancementsWidget::ShaderChanged()
|
||||
{
|
||||
auto shader = ReadSetting(Config::GFX_ENHANCE_POST_SHADER);
|
||||
|
||||
VideoCommon::PostProcessingConfiguration pp_shader;
|
||||
if (Config::Get(Config::GFX_ENHANCE_POST_SHADER) != "")
|
||||
if (shader == "(off)" || shader == "")
|
||||
{
|
||||
pp_shader.LoadShader(Config::Get(Config::GFX_ENHANCE_POST_SHADER));
|
||||
shader = "";
|
||||
|
||||
// Setting a shader to null in a game ini could be confusing, as it won't be bolded. Remove it
|
||||
// instead.
|
||||
if (m_game_layer != nullptr)
|
||||
m_game_layer->DeleteKey(Config::GFX_ENHANCE_POST_SHADER.GetLocation());
|
||||
else
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_POST_SHADER, shader);
|
||||
}
|
||||
|
||||
if (shader != "" && m_pp_effect->isEnabled())
|
||||
{
|
||||
VideoCommon::PostProcessingConfiguration pp_shader;
|
||||
pp_shader.LoadShader(shader);
|
||||
m_configure_pp_effect->setEnabled(pp_shader.HasOptions());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_configure_pp_effect->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
LoadSettings();
|
||||
void EnhancementsWidget::OnConfigChanged()
|
||||
{
|
||||
// Only used for the GameConfigWidget. Bypasses graphics window signals and backend info due to it
|
||||
// being global.
|
||||
m_texture_filtering_combo->setEnabled(ReadSetting(Config::GFX_HACK_FAST_TEXTURE_SAMPLING));
|
||||
m_arbitrary_mipmap_detection->setEnabled(!ReadSetting(Config::GFX_ENABLE_GPU_TEXTURE_DECODING));
|
||||
UpdateAAOptions();
|
||||
|
||||
// Needs to update after deleting a key for 3d settings.
|
||||
LoadPPShaders();
|
||||
}
|
||||
|
||||
void EnhancementsWidget::UpdateAAOptions()
|
||||
{
|
||||
const QSignalBlocker blocker_aa(m_aa_combo);
|
||||
|
||||
m_aa_combo->Reset();
|
||||
m_aa_combo->Add(tr("None"), (u32)1, false);
|
||||
|
||||
std::vector<u32> aa_modes = g_Config.backend_info.AAModes;
|
||||
for (const u32 aa_mode : aa_modes)
|
||||
{
|
||||
if (aa_mode > 1)
|
||||
m_aa_combo->Add(tr("%1x MSAA").arg(aa_mode), aa_mode, false);
|
||||
}
|
||||
|
||||
if (g_Config.backend_info.bSupportsSSAA)
|
||||
{
|
||||
for (const u32 aa_mode : aa_modes)
|
||||
{
|
||||
if (aa_mode > 1)
|
||||
m_aa_combo->Add(tr("%1x SSAA").arg(aa_mode), aa_mode, true);
|
||||
}
|
||||
}
|
||||
|
||||
m_aa_combo->Refresh();
|
||||
|
||||
// Backend info can't be populated in the local game settings window. Only enable local game AA
|
||||
// edits when the backend info is correct - global and local have the same backend.
|
||||
const bool good_info =
|
||||
m_game_layer == nullptr || !m_game_layer->Exists(Config::MAIN_GFX_BACKEND.GetLocation()) ||
|
||||
Config::Get(Config::MAIN_GFX_BACKEND) == m_game_layer->Get(Config::MAIN_GFX_BACKEND);
|
||||
|
||||
m_aa_combo->setEnabled(m_aa_combo->count() > 1 && good_info);
|
||||
}
|
||||
|
||||
void EnhancementsWidget::AddDescriptions()
|
||||
|
@ -713,7 +634,7 @@ void EnhancementsWidget::ConfigureColorCorrection()
|
|||
|
||||
void EnhancementsWidget::ConfigurePostProcessingShader()
|
||||
{
|
||||
const std::string shader = Config::Get(Config::GFX_ENHANCE_POST_SHADER);
|
||||
const std::string shader = ReadSetting(Config::GFX_ENHANCE_POST_SHADER);
|
||||
PostProcessingConfigWindow dialog(this, shader);
|
||||
SetQWidgetWindowDecorations(&dialog);
|
||||
dialog.exec();
|
||||
|
|
|
@ -9,39 +9,52 @@
|
|||
|
||||
class ConfigBool;
|
||||
class ConfigChoice;
|
||||
class ConfigComplexChoice;
|
||||
class ConfigStringChoice;
|
||||
class ConfigSlider;
|
||||
class GameConfigWidget;
|
||||
class GraphicsWindow;
|
||||
class QCheckBox;
|
||||
class QComboBox;
|
||||
class QPushButton;
|
||||
class QSlider;
|
||||
class ToolTipComboBox;
|
||||
class ToolTipPushButton;
|
||||
enum class StereoMode : int;
|
||||
|
||||
namespace Config
|
||||
{
|
||||
template <typename T>
|
||||
class Info;
|
||||
class Layer;
|
||||
} // namespace Config
|
||||
|
||||
class EnhancementsWidget final : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit EnhancementsWidget(GraphicsWindow* parent);
|
||||
EnhancementsWidget(GameConfigWidget* parent, Config::Layer* layer);
|
||||
|
||||
private:
|
||||
void LoadSettings();
|
||||
void SaveSettings();
|
||||
template <typename T>
|
||||
T ReadSetting(const Config::Info<T>& setting) const;
|
||||
|
||||
void CreateWidgets();
|
||||
void ConnectWidgets();
|
||||
void AddDescriptions();
|
||||
|
||||
void OnBackendChanged();
|
||||
void UpdateAAOptions();
|
||||
void LoadPPShaders();
|
||||
void ShaderChanged();
|
||||
void OnConfigChanged();
|
||||
|
||||
void ConfigureColorCorrection();
|
||||
void ConfigurePostProcessingShader();
|
||||
void LoadPPShaders(StereoMode stereo_mode);
|
||||
|
||||
// Enhancements
|
||||
ConfigChoice* m_ir_combo;
|
||||
ToolTipComboBox* m_aa_combo;
|
||||
ToolTipComboBox* m_texture_filtering_combo;
|
||||
ToolTipComboBox* m_output_resampling_combo;
|
||||
ToolTipComboBox* m_pp_effect;
|
||||
ConfigComplexChoice* m_aa_combo;
|
||||
ConfigComplexChoice* m_texture_filtering_combo;
|
||||
ConfigChoice* m_output_resampling_combo;
|
||||
ConfigStringChoice* m_pp_effect;
|
||||
ToolTipPushButton* m_configure_color_correction;
|
||||
QPushButton* m_configure_pp_effect;
|
||||
ConfigBool* m_scaled_efb_copy;
|
||||
|
@ -60,6 +73,5 @@ private:
|
|||
ConfigBool* m_3d_swap_eyes;
|
||||
ConfigBool* m_3d_per_eye_resolution;
|
||||
|
||||
int m_msaa_modes;
|
||||
bool m_block_save;
|
||||
Config::Layer* m_game_layer = nullptr;
|
||||
};
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "DolphinQt/Config/ConfigControls/ConfigChoice.h"
|
||||
#include "DolphinQt/Config/ConfigControls/ConfigInteger.h"
|
||||
#include "DolphinQt/Config/ConfigControls/ConfigRadio.h"
|
||||
#include "DolphinQt/Config/GameConfigWidget.h"
|
||||
#include "DolphinQt/Config/Graphics/GraphicsWindow.h"
|
||||
#include "DolphinQt/Config/ToolTipControls/ToolTipComboBox.h"
|
||||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||
|
@ -38,7 +39,6 @@ GeneralWidget::GeneralWidget(GraphicsWindow* parent)
|
|||
LoadSettings();
|
||||
ConnectWidgets();
|
||||
AddDescriptions();
|
||||
emit BackendChanged(QString::fromStdString(Config::Get(Config::MAIN_GFX_BACKEND)));
|
||||
|
||||
connect(parent, &GraphicsWindow::BackendChanged, this, &GeneralWidget::OnBackendChanged);
|
||||
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, [this](Core::State state) {
|
||||
|
@ -47,6 +47,14 @@ GeneralWidget::GeneralWidget(GraphicsWindow* parent)
|
|||
OnEmulationStateChanged(!Core::IsUninitialized(Core::System::GetInstance()));
|
||||
}
|
||||
|
||||
GeneralWidget::GeneralWidget(GameConfigWidget* parent, Config::Layer* layer) : m_game_layer(layer)
|
||||
{
|
||||
CreateWidgets();
|
||||
LoadSettings();
|
||||
ConnectWidgets();
|
||||
AddDescriptions();
|
||||
}
|
||||
|
||||
void GeneralWidget::CreateWidgets()
|
||||
{
|
||||
auto* main_layout = new QVBoxLayout;
|
||||
|
@ -55,33 +63,36 @@ void GeneralWidget::CreateWidgets()
|
|||
auto* m_video_box = new QGroupBox(tr("Basic"));
|
||||
m_video_layout = new QGridLayout();
|
||||
|
||||
m_backend_combo = new ToolTipComboBox();
|
||||
std::vector<std::pair<QString, QString>> options;
|
||||
for (auto& backend : VideoBackendBase::GetAvailableBackends())
|
||||
{
|
||||
options.push_back(std::make_pair(tr(backend->GetDisplayName().c_str()),
|
||||
QString::fromStdString(backend->GetName())));
|
||||
}
|
||||
m_backend_combo = new ConfigStringChoice(options, Config::MAIN_GFX_BACKEND, m_game_layer);
|
||||
m_previous_backend = m_backend_combo->currentIndex();
|
||||
|
||||
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);
|
||||
Config::GFX_ASPECT_RATIO, m_game_layer);
|
||||
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);
|
||||
Config::GFX_CUSTOM_ASPECT_RATIO_WIDTH, m_game_layer);
|
||||
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);
|
||||
Config::GFX_CUSTOM_ASPECT_RATIO_HEIGHT, m_game_layer);
|
||||
m_custom_aspect_height->setEnabled(false);
|
||||
m_custom_aspect_height->setHidden(true);
|
||||
m_adapter_combo = new ToolTipComboBox;
|
||||
m_enable_vsync = new ConfigBool(tr("V-Sync"), Config::GFX_VSYNC);
|
||||
m_enable_fullscreen = new ConfigBool(tr("Start in Fullscreen"), Config::MAIN_FULLSCREEN);
|
||||
m_enable_vsync = new ConfigBool(tr("V-Sync"), Config::GFX_VSYNC, m_game_layer);
|
||||
m_enable_fullscreen =
|
||||
new ConfigBool(tr("Start in Fullscreen"), Config::MAIN_FULLSCREEN, m_game_layer);
|
||||
|
||||
m_video_box->setLayout(m_video_layout);
|
||||
|
||||
for (auto& backend : VideoBackendBase::GetAvailableBackends())
|
||||
{
|
||||
m_backend_combo->addItem(tr(backend->GetDisplayName().c_str()),
|
||||
QVariant(QString::fromStdString(backend->GetName())));
|
||||
}
|
||||
|
||||
m_video_layout->addWidget(new QLabel(tr("Backend:")), 0, 0);
|
||||
m_video_layout->addWidget(m_backend_combo, 0, 1, 1, -1);
|
||||
|
||||
|
@ -102,12 +113,15 @@ void GeneralWidget::CreateWidgets()
|
|||
auto* m_options_box = new QGroupBox(tr("Other"));
|
||||
auto* m_options_layout = new QGridLayout();
|
||||
|
||||
m_show_ping = new ConfigBool(tr("Show NetPlay Ping"), Config::GFX_SHOW_NETPLAY_PING);
|
||||
m_show_turn_count = new ConfigBool(tr("Show MP Turn"), Config::GFX_SHOW_MP_TURN);
|
||||
m_autoadjust_window_size =
|
||||
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);
|
||||
m_show_ping =
|
||||
new ConfigBool(tr("Show NetPlay Ping"), Config::GFX_SHOW_NETPLAY_PING, m_game_layer);
|
||||
m_autoadjust_window_size = new ConfigBool(tr("Auto-Adjust Window Size"),
|
||||
Config::MAIN_RENDER_WINDOW_AUTOSIZE, m_game_layer);
|
||||
m_show_turn_count = new ConfigBool(tr("Show MP Turn"), Config::GFX_SHOW_MP_TURN. m_game_layer);
|
||||
m_show_messages =
|
||||
new ConfigBool(tr("Show NetPlay Messages"), Config::GFX_SHOW_NETPLAY_MESSAGES, m_game_layer);
|
||||
m_render_main_window =
|
||||
new ConfigBool(tr("Render to Main Window"), Config::MAIN_RENDER_TO_MAIN, m_game_layer);
|
||||
|
||||
m_options_box->setLayout(m_options_layout);
|
||||
|
||||
|
@ -130,13 +144,13 @@ void GeneralWidget::CreateWidgets()
|
|||
}};
|
||||
for (size_t i = 0; i < modes.size(); i++)
|
||||
{
|
||||
m_shader_compilation_mode[i] =
|
||||
new ConfigRadioInt(tr(modes[i]), Config::GFX_SHADER_COMPILATION_MODE, static_cast<int>(i));
|
||||
m_shader_compilation_mode[i] = new ConfigRadioInt(
|
||||
tr(modes[i]), Config::GFX_SHADER_COMPILATION_MODE, static_cast<int>(i), m_game_layer);
|
||||
shader_compilation_layout->addWidget(m_shader_compilation_mode[i], static_cast<int>(i / 2),
|
||||
static_cast<int>(i % 2));
|
||||
}
|
||||
m_wait_for_shaders = new ConfigBool(tr("Compile Shaders Before Starting"),
|
||||
Config::GFX_WAIT_FOR_SHADERS_BEFORE_STARTING);
|
||||
Config::GFX_WAIT_FOR_SHADERS_BEFORE_STARTING, m_game_layer);
|
||||
shader_compilation_layout->addWidget(m_wait_for_shaders);
|
||||
shader_compilation_box->setLayout(shader_compilation_layout);
|
||||
|
||||
|
@ -151,7 +165,7 @@ void GeneralWidget::CreateWidgets()
|
|||
void GeneralWidget::ConnectWidgets()
|
||||
{
|
||||
// Video Backend
|
||||
connect(m_backend_combo, &QComboBox::currentIndexChanged, this, &GeneralWidget::SaveSettings);
|
||||
connect(m_backend_combo, &QComboBox::currentIndexChanged, this, &GeneralWidget::BackendWarning);
|
||||
connect(m_adapter_combo, &QComboBox::currentIndexChanged, this, [&](int index) {
|
||||
g_Config.iAdapter = index;
|
||||
Config::SetBaseOrCurrent(Config::GFX_ADAPTER, index);
|
||||
|
@ -170,10 +184,6 @@ void GeneralWidget::ConnectWidgets()
|
|||
|
||||
void GeneralWidget::LoadSettings()
|
||||
{
|
||||
// Video Backend
|
||||
m_backend_combo->setCurrentIndex(m_backend_combo->findData(
|
||||
QVariant(QString::fromStdString(Config::Get(Config::MAIN_GFX_BACKEND)))));
|
||||
|
||||
const bool is_custom_aspect_ratio =
|
||||
(Config::Get(Config::GFX_ASPECT_RATIO) == AspectMode::Custom) ||
|
||||
(Config::Get(Config::GFX_ASPECT_RATIO) == AspectMode::CustomStretch);
|
||||
|
@ -184,13 +194,8 @@ void GeneralWidget::LoadSettings()
|
|||
m_custom_aspect_height->setHidden(!is_custom_aspect_ratio);
|
||||
}
|
||||
|
||||
void GeneralWidget::SaveSettings()
|
||||
void GeneralWidget::BackendWarning()
|
||||
{
|
||||
// Video Backend
|
||||
const auto current_backend = m_backend_combo->currentData().toString().toStdString();
|
||||
if (Config::Get(Config::MAIN_GFX_BACKEND) == current_backend)
|
||||
return;
|
||||
|
||||
if (Config::GetActiveLayerForConfig(Config::MAIN_GFX_BACKEND) == Config::LayerType::Base)
|
||||
{
|
||||
auto warningMessage = VideoBackendBase::GetAvailableBackends()[m_backend_combo->currentIndex()]
|
||||
|
@ -207,15 +212,14 @@ void GeneralWidget::SaveSettings()
|
|||
SetQWidgetWindowDecorations(&confirm_sw);
|
||||
if (confirm_sw.exec() != QMessageBox::Yes)
|
||||
{
|
||||
m_backend_combo->setCurrentIndex(m_backend_combo->findData(
|
||||
QVariant(QString::fromStdString(Config::Get(Config::MAIN_GFX_BACKEND)))));
|
||||
m_backend_combo->setCurrentIndex(m_previous_backend);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Config::SetBaseOrCurrent(Config::MAIN_GFX_BACKEND, current_backend);
|
||||
emit BackendChanged(QString::fromStdString(current_backend));
|
||||
m_previous_backend = m_backend_combo->currentIndex();
|
||||
emit BackendChanged(m_backend_combo->currentData().toString());
|
||||
}
|
||||
|
||||
void GeneralWidget::OnEmulationStateChanged(bool running)
|
||||
|
@ -229,7 +233,10 @@ void GeneralWidget::OnEmulationStateChanged(bool running)
|
|||
|
||||
std::string current_backend = m_backend_combo->currentData().toString().toStdString();
|
||||
if (Config::Get(Config::MAIN_GFX_BACKEND) != current_backend)
|
||||
{
|
||||
m_backend_combo->Load();
|
||||
emit BackendChanged(QString::fromStdString(Config::Get(Config::MAIN_GFX_BACKEND)));
|
||||
}
|
||||
}
|
||||
|
||||
void GeneralWidget::AddDescriptions()
|
||||
|
@ -241,7 +248,7 @@ void GeneralWidget::AddDescriptions()
|
|||
"recommended. Different games and different GPUs will behave differently on each "
|
||||
"backend, so for the best emulation experience it is recommended to try each and "
|
||||
"select the backend that is least problematic.<br><br><dolphin_emphasis>If unsure, "
|
||||
"select OpenGL.</dolphin_emphasis>");
|
||||
"select %1.</dolphin_emphasis>");
|
||||
static const char TR_FULLSCREEN_DESCRIPTION[] =
|
||||
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 "
|
||||
|
@ -313,7 +320,9 @@ void GeneralWidget::AddDescriptions()
|
|||
"unsure, leave this unchecked.</dolphin_emphasis>");
|
||||
|
||||
m_backend_combo->SetTitle(tr("Backend"));
|
||||
m_backend_combo->SetDescription(tr(TR_BACKEND_DESCRIPTION));
|
||||
m_backend_combo->SetDescription(
|
||||
tr(TR_BACKEND_DESCRIPTION)
|
||||
.arg(QString::fromStdString(VideoBackendBase::GetDefaultBackendDisplayName())));
|
||||
|
||||
m_adapter_combo->SetTitle(tr("Adapter"));
|
||||
|
||||
|
@ -348,8 +357,6 @@ void GeneralWidget::AddDescriptions()
|
|||
|
||||
void GeneralWidget::OnBackendChanged(const QString& backend_name)
|
||||
{
|
||||
m_backend_combo->setCurrentIndex(m_backend_combo->findData(QVariant(backend_name)));
|
||||
|
||||
const QSignalBlocker blocker(m_adapter_combo);
|
||||
|
||||
m_adapter_combo->clear();
|
||||
|
|
|
@ -11,6 +11,8 @@ class ConfigBool;
|
|||
class ConfigChoice;
|
||||
class ConfigInteger;
|
||||
class ConfigRadioInt;
|
||||
class ConfigStringChoice;
|
||||
class GameConfigWidget;
|
||||
class GraphicsWindow;
|
||||
class QCheckBox;
|
||||
class QComboBox;
|
||||
|
@ -19,17 +21,24 @@ class QRadioButton;
|
|||
class QGridLayout;
|
||||
class ToolTipComboBox;
|
||||
|
||||
namespace Config
|
||||
{
|
||||
class Layer;
|
||||
} // namespace Config
|
||||
|
||||
class GeneralWidget final : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit GeneralWidget(GraphicsWindow* parent);
|
||||
GeneralWidget(GameConfigWidget* parent, Config::Layer* layer);
|
||||
|
||||
signals:
|
||||
void BackendChanged(const QString& backend);
|
||||
|
||||
private:
|
||||
void LoadSettings();
|
||||
void SaveSettings();
|
||||
void BackendWarning();
|
||||
|
||||
void CreateWidgets();
|
||||
void ConnectWidgets();
|
||||
|
@ -40,7 +49,7 @@ private:
|
|||
|
||||
// Video
|
||||
QGridLayout* m_video_layout;
|
||||
ToolTipComboBox* m_backend_combo;
|
||||
ConfigStringChoice* m_backend_combo;
|
||||
ToolTipComboBox* m_adapter_combo;
|
||||
ConfigChoice* m_aspect_combo;
|
||||
QLabel* m_custom_aspect_label;
|
||||
|
@ -57,4 +66,6 @@ private:
|
|||
ConfigBool* m_render_main_window;
|
||||
std::array<ConfigRadioInt*, 4> m_shader_compilation_mode{};
|
||||
ConfigBool* m_wait_for_shaders;
|
||||
int m_previous_backend = 0;
|
||||
Config::Layer* m_game_layer = nullptr;
|
||||
};
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "DolphinQt/Config/ConfigControls/ConfigBool.h"
|
||||
#include "DolphinQt/Config/ConfigControls/ConfigSlider.h"
|
||||
#include "DolphinQt/Config/GameConfigWidget.h"
|
||||
#include "DolphinQt/Config/Graphics/GraphicsWindow.h"
|
||||
#include "DolphinQt/Config/ToolTipControls/ToolTipSlider.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
@ -37,6 +38,14 @@ HacksWidget::HacksWidget(GraphicsWindow* parent)
|
|||
});
|
||||
}
|
||||
|
||||
HacksWidget::HacksWidget(GameConfigWidget* parent, Config::Layer* layer) : m_game_layer(layer)
|
||||
{
|
||||
CreateWidgets();
|
||||
LoadSettings();
|
||||
ConnectWidgets();
|
||||
AddDescriptions();
|
||||
}
|
||||
|
||||
void HacksWidget::CreateWidgets()
|
||||
{
|
||||
auto* main_layout = new QVBoxLayout;
|
||||
|
@ -45,14 +54,14 @@ void HacksWidget::CreateWidgets()
|
|||
auto* efb_box = new QGroupBox(tr("Embedded Frame Buffer (EFB)"));
|
||||
auto* efb_layout = new QGridLayout();
|
||||
efb_box->setLayout(efb_layout);
|
||||
m_skip_efb_cpu =
|
||||
new ConfigBool(tr("Skip EFB Access from CPU"), Config::GFX_HACK_EFB_ACCESS_ENABLE, true);
|
||||
m_ignore_format_changes = new ConfigBool(tr("Ignore Format Changes"),
|
||||
Config::GFX_HACK_EFB_EMULATE_FORMAT_CHANGES, true);
|
||||
m_store_efb_copies =
|
||||
new ConfigBool(tr("Store EFB Copies to Texture Only"), Config::GFX_HACK_SKIP_EFB_COPY_TO_RAM);
|
||||
m_defer_efb_copies =
|
||||
new ConfigBool(tr("Defer EFB Copies to RAM"), Config::GFX_HACK_DEFER_EFB_COPIES);
|
||||
m_skip_efb_cpu = new ConfigBool(tr("Skip EFB Access from CPU"),
|
||||
Config::GFX_HACK_EFB_ACCESS_ENABLE, m_game_layer, true);
|
||||
m_ignore_format_changes = new ConfigBool(
|
||||
tr("Ignore Format Changes"), Config::GFX_HACK_EFB_EMULATE_FORMAT_CHANGES, m_game_layer, true);
|
||||
m_store_efb_copies = new ConfigBool(tr("Store EFB Copies to Texture Only"),
|
||||
Config::GFX_HACK_SKIP_EFB_COPY_TO_RAM, m_game_layer);
|
||||
m_defer_efb_copies = new ConfigBool(tr("Defer EFB Copies to RAM"),
|
||||
Config::GFX_HACK_DEFER_EFB_COPIES, m_game_layer);
|
||||
|
||||
efb_layout->addWidget(m_skip_efb_cpu, 0, 0);
|
||||
efb_layout->addWidget(m_ignore_format_changes, 0, 1);
|
||||
|
@ -69,8 +78,8 @@ void HacksWidget::CreateWidgets()
|
|||
m_accuracy->setMaximum(2);
|
||||
m_accuracy->setPageStep(1);
|
||||
m_accuracy->setTickPosition(QSlider::TicksBelow);
|
||||
m_gpu_texture_decoding =
|
||||
new ConfigBool(tr("GPU Texture Decoding"), Config::GFX_ENABLE_GPU_TEXTURE_DECODING);
|
||||
m_gpu_texture_decoding = new ConfigBool(tr("GPU Texture Decoding"),
|
||||
Config::GFX_ENABLE_GPU_TEXTURE_DECODING, m_game_layer);
|
||||
|
||||
auto* safe_label = new QLabel(tr("Safe"));
|
||||
safe_label->setAlignment(Qt::AlignRight);
|
||||
|
@ -88,11 +97,12 @@ void HacksWidget::CreateWidgets()
|
|||
auto* xfb_layout = new QVBoxLayout();
|
||||
xfb_box->setLayout(xfb_layout);
|
||||
|
||||
m_store_xfb_copies =
|
||||
new ConfigBool(tr("Store XFB Copies to Texture Only"), Config::GFX_HACK_SKIP_XFB_COPY_TO_RAM);
|
||||
m_immediate_xfb = new ConfigBool(tr("Immediately Present XFB"), Config::GFX_HACK_IMMEDIATE_XFB);
|
||||
m_skip_duplicate_xfbs =
|
||||
new ConfigBool(tr("Skip Presenting Duplicate Frames"), Config::GFX_HACK_SKIP_DUPLICATE_XFBS);
|
||||
m_store_xfb_copies = new ConfigBool(tr("Store XFB Copies to Texture Only"),
|
||||
Config::GFX_HACK_SKIP_XFB_COPY_TO_RAM, m_game_layer);
|
||||
m_immediate_xfb =
|
||||
new ConfigBool(tr("Immediately Present XFB"), Config::GFX_HACK_IMMEDIATE_XFB, m_game_layer);
|
||||
m_skip_duplicate_xfbs = new ConfigBool(tr("Skip Presenting Duplicate Frames"),
|
||||
Config::GFX_HACK_SKIP_DUPLICATE_XFBS, m_game_layer);
|
||||
|
||||
xfb_layout->addWidget(m_store_xfb_copies);
|
||||
xfb_layout->addWidget(m_immediate_xfb);
|
||||
|
@ -104,13 +114,14 @@ void HacksWidget::CreateWidgets()
|
|||
other_box->setLayout(other_layout);
|
||||
|
||||
m_fast_depth_calculation =
|
||||
new ConfigBool(tr("Fast Depth Calculation"), Config::GFX_FAST_DEPTH_CALC);
|
||||
new ConfigBool(tr("Fast Depth Calculation"), Config::GFX_FAST_DEPTH_CALC, m_game_layer);
|
||||
m_disable_bounding_box =
|
||||
new ConfigBool(tr("Disable Bounding Box"), Config::GFX_HACK_BBOX_ENABLE, true);
|
||||
m_vertex_rounding = new ConfigBool(tr("Vertex Rounding"), Config::GFX_HACK_VERTEX_ROUNDING);
|
||||
m_save_texture_cache_state =
|
||||
new ConfigBool(tr("Save Texture Cache to State"), Config::GFX_SAVE_TEXTURE_CACHE_TO_STATE);
|
||||
m_vi_skip = new ConfigBool(tr("VBI Skip"), Config::GFX_HACK_VI_SKIP);
|
||||
new ConfigBool(tr("Disable Bounding Box"), Config::GFX_HACK_BBOX_ENABLE, m_game_layer, true);
|
||||
m_vertex_rounding =
|
||||
new ConfigBool(tr("Vertex Rounding"), Config::GFX_HACK_VERTEX_ROUNDING, m_game_layer);
|
||||
m_save_texture_cache_state = new ConfigBool(
|
||||
tr("Save Texture Cache to State"), Config::GFX_SAVE_TEXTURE_CACHE_TO_STATE, m_game_layer);
|
||||
m_vi_skip = new ConfigBool(tr("VBI Skip"), Config::GFX_HACK_VI_SKIP, m_game_layer);
|
||||
|
||||
other_layout->addWidget(m_fast_depth_calculation, 0, 0);
|
||||
other_layout->addWidget(m_disable_bounding_box, 0, 1);
|
||||
|
@ -223,7 +234,7 @@ void HacksWidget::AddDescriptions()
|
|||
"Ignores any requests from the CPU to read from or write to the EFB. "
|
||||
"<br><br>Improves performance in some games, but will disable all EFB-based "
|
||||
"graphical effects or gameplay-related features.<br><br><dolphin_emphasis>If unsure, "
|
||||
"leave this unchecked.</dolphin_emphasis>");
|
||||
"leave this checked.</dolphin_emphasis>");
|
||||
static const char TR_IGNORE_FORMAT_CHANGE_DESCRIPTION[] = QT_TR_NOOP(
|
||||
"Ignores any changes to the EFB format.<br><br>Improves performance in many games "
|
||||
"without "
|
||||
|
|
|
@ -6,15 +6,22 @@
|
|||
#include <QWidget>
|
||||
|
||||
class ConfigBool;
|
||||
class GameConfigWidget;
|
||||
class GraphicsWindow;
|
||||
class QLabel;
|
||||
class ToolTipSlider;
|
||||
|
||||
namespace Config
|
||||
{
|
||||
class Layer;
|
||||
} // namespace Config
|
||||
|
||||
class HacksWidget final : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit HacksWidget(GraphicsWindow* parent);
|
||||
HacksWidget(GameConfigWidget* parent, Config::Layer* layer);
|
||||
|
||||
private:
|
||||
void LoadSettings();
|
||||
|
@ -45,6 +52,8 @@ private:
|
|||
ConfigBool* m_vi_skip;
|
||||
ConfigBool* m_save_texture_cache_state;
|
||||
|
||||
Config::Layer* m_game_layer = nullptr;
|
||||
|
||||
void CreateWidgets();
|
||||
void ConnectWidgets();
|
||||
void AddDescriptions();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue