mirror of https://github.com/stenzek/duckstation
Qt: Split GPU options into display and enhancements
parent
14778b5d24
commit
330722eb5f
@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <QtWidgets/QWidget>
|
||||
|
||||
#include "ui_displaysettingswidget.h"
|
||||
|
||||
class QtHostInterface;
|
||||
class SettingsDialog;
|
||||
|
||||
class DisplaySettingsWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DisplaySettingsWidget(QtHostInterface* host_interface, QWidget* parent, SettingsDialog* dialog);
|
||||
~DisplaySettingsWidget();
|
||||
|
||||
private Q_SLOTS:
|
||||
void populateGPUAdapters();
|
||||
void onGPUAdapterIndexChanged();
|
||||
|
||||
private:
|
||||
void setupAdditionalUi();
|
||||
|
||||
Ui::DisplaySettingsWidget m_ui;
|
||||
|
||||
QtHostInterface* m_host_interface;
|
||||
};
|
@ -0,0 +1,169 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>DisplaySettingsWidget</class>
|
||||
<widget class="QWidget" name="DisplaySettingsWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>448</width>
|
||||
<height>720</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Basic</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Renderer:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="renderer"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Adapter:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="adapter"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="title">
|
||||
<string>Screen Display</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_4">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Aspect Ratio:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="displayAspectRatio"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Crop:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="displayCropMode"/>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="displayLinearFiltering">
|
||||
<property name="text">
|
||||
<string>Linear Upscaling</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="displayIntegerScaling">
|
||||
<property name="text">
|
||||
<string>Integer Upscaling</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="vsync">
|
||||
<property name="text">
|
||||
<string>VSync</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_5">
|
||||
<property name="title">
|
||||
<string>On-Screen Display</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="formLayout_5">
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="showOSDMessages">
|
||||
<property name="text">
|
||||
<string>Show Messages</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QCheckBox" name="showFPS">
|
||||
<property name="text">
|
||||
<string>Show FPS</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="showSpeed">
|
||||
<property name="text">
|
||||
<string>Show Emulation Speed</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QCheckBox" name="showVPS">
|
||||
<property name="text">
|
||||
<string>Show VPS</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QCheckBox" name="showResolution">
|
||||
<property name="text">
|
||||
<string>Show Resolution</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,106 @@
|
||||
#include "enhancementsettingswidget.h"
|
||||
#include "core/gpu.h"
|
||||
#include "core/settings.h"
|
||||
#include "qtutils.h"
|
||||
#include "settingsdialog.h"
|
||||
#include "settingwidgetbinder.h"
|
||||
|
||||
EnhancementSettingsWidget::EnhancementSettingsWidget(QtHostInterface* host_interface, QWidget* parent, SettingsDialog* dialog)
|
||||
: QWidget(parent), m_host_interface(host_interface)
|
||||
{
|
||||
m_ui.setupUi(this);
|
||||
setupAdditionalUi();
|
||||
|
||||
SettingWidgetBinder::BindWidgetToIntSetting(m_host_interface, m_ui.resolutionScale, "GPU", "ResolutionScale");
|
||||
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.trueColor, "GPU", "TrueColor");
|
||||
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.scaledDithering, "GPU", "ScaledDithering");
|
||||
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.disableInterlacing, "GPU", "DisableInterlacing");
|
||||
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.forceNTSCTimings, "GPU", "ForceNTSCTimings");
|
||||
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.linearTextureFiltering, "GPU",
|
||||
"TextureFiltering");
|
||||
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.widescreenHack, "GPU", "WidescreenHack");
|
||||
|
||||
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.pgxpEnable, "GPU", "PGXPEnable", false);
|
||||
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.pgxpCulling, "GPU", "PGXPCulling", true);
|
||||
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.pgxpTextureCorrection, "GPU",
|
||||
"PGXPTextureCorrection", true);
|
||||
|
||||
connect(m_ui.resolutionScale, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
|
||||
&EnhancementSettingsWidget::updateScaledDitheringEnabled);
|
||||
connect(m_ui.trueColor, &QCheckBox::stateChanged, this, &EnhancementSettingsWidget::updateScaledDitheringEnabled);
|
||||
updateScaledDitheringEnabled();
|
||||
|
||||
connect(m_ui.pgxpEnable, &QCheckBox::stateChanged, this, &EnhancementSettingsWidget::updatePGXPSettingsEnabled);
|
||||
updatePGXPSettingsEnabled();
|
||||
|
||||
dialog->registerWidgetHelp(
|
||||
m_ui.disableInterlacing, tr("Disable Interlacing (force progressive render/scan)"), tr("Unchecked"),
|
||||
tr(
|
||||
"Forces the rendering and display of frames to progressive mode. <br>This removes the \"combing\" effect seen in "
|
||||
"480i games by rendering them in 480p. Usually safe to enable.<br> "
|
||||
"<b><u>May not be compatible with all games.</u></b>"));
|
||||
dialog->registerWidgetHelp(
|
||||
m_ui.resolutionScale, tr("Resolution Scale"), "1x",
|
||||
tr("Setting this beyond 1x will enhance the resolution of rendered 3D polygons and lines. Only applies "
|
||||
"to the hardware backends. <br>This option is usually safe, with most games looking fine at "
|
||||
"higher resolutions. Higher resolutions require a more powerful GPU."));
|
||||
dialog->registerWidgetHelp(
|
||||
m_ui.trueColor, tr("True Color Rendering (24-bit, disables dithering)"), tr("Unchecked"),
|
||||
tr("Forces the precision of colours output to the console's framebuffer to use the full 8 bits of precision per "
|
||||
"channel. This produces nicer looking gradients at the cost of making some colours look slightly different. "
|
||||
"Disabling the option also enables dithering, which makes the transition between colours less sharp by applying "
|
||||
"a pattern around those pixels. Most games are compatible with this option, but there is a number which aren't "
|
||||
"and will have broken effects with it enabled. Only applies to the hardware renderers."));
|
||||
dialog->registerWidgetHelp(
|
||||
m_ui.scaledDithering, tr("Scaled Dithering (scale dither pattern to resolution)"), tr("Checked"),
|
||||
tr("Scales the dither pattern to the resolution scale of the emulated GPU. This makes the dither pattern much less "
|
||||
"obvious at higher resolutions. <br>Usually safe to enable, and only supported by the hardware renderers."));
|
||||
dialog->registerWidgetHelp(m_ui.forceNTSCTimings, tr("Force NTSC Timings (60hz-on-PAL)"), tr("Unchecked"),
|
||||
tr("Uses NTSC frame timings when the console is in PAL mode, forcing PAL games to run at "
|
||||
"60hz. <br>For most games which "
|
||||
"have a speed tied to the framerate, this will result in the game running "
|
||||
"approximately 17% faster. <br>For variable "
|
||||
"frame rate games, it may not affect the speed."));
|
||||
dialog->registerWidgetHelp(
|
||||
m_ui.linearTextureFiltering, tr("Bilinear Texture Filtering"), tr("Unchecked"),
|
||||
tr("Smooths out the blockyness of magnified textures on 3D object by using bilinear filtering. <br>Will have a "
|
||||
"greater effect on higher resolution scales. Only applies to the hardware renderers."));
|
||||
dialog->registerWidgetHelp(
|
||||
m_ui.widescreenHack, tr("Widescreen Hack"), tr("Unchecked"),
|
||||
tr("Scales vertex positions in screen-space to a widescreen aspect ratio, essentially "
|
||||
"increasing the field of view from 4:3 to 16:9 in 3D games. <br>For 2D games, or games which "
|
||||
"use pre-rendered backgrounds, this enhancement will not work as expected. <br><b><u>May not be compatible with "
|
||||
"all games.</u></b>"));
|
||||
dialog->registerWidgetHelp(
|
||||
m_ui.pgxpEnable, tr("Geometry Correction"), tr("Unchecked"),
|
||||
tr("Reduces \"wobbly\" polygons and \"warping\" textures that are common in PS1 games. <br>Only "
|
||||
"works with the hardware renderers. <b><u>May not be compatible with all games.</u></b>"));
|
||||
dialog->registerWidgetHelp(m_ui.pgxpCulling, tr("Culling Correction"), tr("Checked"),
|
||||
tr("Increases the precision of polygon culling, reducing the number of holes in geometry. "
|
||||
"Requires geometry correction enabled."));
|
||||
dialog->registerWidgetHelp(m_ui.pgxpTextureCorrection, tr("Texture Correction"), tr("Checked"),
|
||||
tr("Uses perspective-correct interpolation for texture coordinates and colors, "
|
||||
"straightening out warped textures. Requires geometry correction enabled."));
|
||||
}
|
||||
|
||||
EnhancementSettingsWidget::~EnhancementSettingsWidget() = default;
|
||||
|
||||
void EnhancementSettingsWidget::updateScaledDitheringEnabled()
|
||||
{
|
||||
const int resolution_scale = m_ui.resolutionScale->currentIndex();
|
||||
const bool true_color = m_ui.trueColor->isChecked();
|
||||
const bool allow_scaled_dithering = (resolution_scale != 1 && !true_color);
|
||||
m_ui.scaledDithering->setEnabled(allow_scaled_dithering);
|
||||
}
|
||||
|
||||
void EnhancementSettingsWidget::setupAdditionalUi()
|
||||
{
|
||||
QtUtils::FillComboBoxWithResolutionScales(m_ui.resolutionScale);
|
||||
}
|
||||
|
||||
void EnhancementSettingsWidget::updatePGXPSettingsEnabled()
|
||||
{
|
||||
const bool enabled = m_ui.pgxpEnable->isChecked();
|
||||
m_ui.pgxpCulling->setEnabled(enabled);
|
||||
m_ui.pgxpTextureCorrection->setEnabled(enabled);
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <QtWidgets/QWidget>
|
||||
|
||||
#include "ui_enhancementsettingswidget.h"
|
||||
|
||||
class QtHostInterface;
|
||||
class SettingsDialog;
|
||||
|
||||
class EnhancementSettingsWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
EnhancementSettingsWidget(QtHostInterface* host_interface, QWidget* parent, SettingsDialog* dialog);
|
||||
~EnhancementSettingsWidget();
|
||||
|
||||
private Q_SLOTS:
|
||||
void updateScaledDitheringEnabled();
|
||||
void updatePGXPSettingsEnabled();
|
||||
|
||||
private:
|
||||
void setupAdditionalUi();
|
||||
|
||||
Ui::EnhancementSettingsWidget m_ui;
|
||||
|
||||
QtHostInterface* m_host_interface;
|
||||
};
|
@ -1,30 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <QtWidgets/QWidget>
|
||||
|
||||
#include "ui_gpusettingswidget.h"
|
||||
|
||||
class QtHostInterface;
|
||||
class SettingsDialog;
|
||||
|
||||
class GPUSettingsWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GPUSettingsWidget(QtHostInterface* host_interface, QWidget* parent, SettingsDialog* dialog);
|
||||
~GPUSettingsWidget();
|
||||
|
||||
private Q_SLOTS:
|
||||
void updateScaledDitheringEnabled();
|
||||
void populateGPUAdapters();
|
||||
void onGPUAdapterIndexChanged();
|
||||
void updatePGXPSettingsEnabled();
|
||||
|
||||
private:
|
||||
void setupAdditionalUi();
|
||||
|
||||
Ui::GPUSettingsWidget m_ui;
|
||||
|
||||
QtHostInterface* m_host_interface;
|
||||
};
|
Loading…
Reference in New Issue