mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-26 07:35:41 +00:00
GameSettings: Add PGXP tolerance and MSAA
This commit is contained in:
parent
f0ff7ce231
commit
f7a75941b5
|
@ -135,6 +135,9 @@ void GamePropertiesDialog::setupAdditionalUi()
|
|||
m_ui.userResolutionScale->addItem(tr("(unchanged)"));
|
||||
QtUtils::FillComboBoxWithResolutionScales(m_ui.userResolutionScale);
|
||||
|
||||
m_ui.userMSAAMode->addItem(tr("(unchanged)"));
|
||||
QtUtils::FillComboBoxWithMSAAModes(m_ui.userMSAAMode);
|
||||
|
||||
m_ui.userTextureFiltering->addItem(tr("(unchanged)"));
|
||||
for (u32 i = 0; i < static_cast<u32>(GPUTextureFilter::Count); i++)
|
||||
{
|
||||
|
@ -307,6 +310,11 @@ void GamePropertiesDialog::populateGameSettings()
|
|||
QSignalBlocker sb(m_ui.gpuMaxRunAhead);
|
||||
m_ui.gpuMaxRunAhead->setValue(static_cast<int>(gs.gpu_max_run_ahead.value()));
|
||||
}
|
||||
if (gs.gpu_pgxp_tolerance.has_value())
|
||||
{
|
||||
QSignalBlocker sb(m_ui.gpuPGXPTolerance);
|
||||
m_ui.gpuPGXPTolerance->setValue(static_cast<double>(gs.gpu_pgxp_tolerance.value()));
|
||||
}
|
||||
|
||||
if (gs.display_crop_mode.has_value())
|
||||
{
|
||||
|
@ -333,6 +341,21 @@ void GamePropertiesDialog::populateGameSettings()
|
|||
m_ui.userResolutionScale->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
if (gs.gpu_multisamples.has_value() && gs.gpu_per_sample_shading.has_value())
|
||||
{
|
||||
QSignalBlocker sb(m_ui.userMSAAMode);
|
||||
const QVariant current_msaa_mode(
|
||||
QtUtils::GetMSAAModeValue(static_cast<uint>(gs.gpu_multisamples.value()), gs.gpu_per_sample_shading.has_value()));
|
||||
const int current_msaa_index = m_ui.userMSAAMode->findData(current_msaa_mode);
|
||||
if (current_msaa_index >= 0)
|
||||
m_ui.userMSAAMode->setCurrentIndex((current_msaa_index >= 0) ? current_msaa_index : 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
QSignalBlocker sb(m_ui.userMSAAMode);
|
||||
m_ui.userMSAAMode->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
if (gs.gpu_texture_filter.has_value())
|
||||
{
|
||||
QSignalBlocker sb(m_ui.userTextureFiltering);
|
||||
|
@ -497,6 +520,23 @@ void GamePropertiesDialog::connectUi()
|
|||
saveGameSettings();
|
||||
});
|
||||
|
||||
connect(m_ui.userMSAAMode, QOverload<int>::of(&QComboBox::currentIndexChanged), [this](int index) {
|
||||
if (index == 0)
|
||||
{
|
||||
m_game_settings.gpu_multisamples.reset();
|
||||
m_game_settings.gpu_per_sample_shading.reset();
|
||||
}
|
||||
else
|
||||
{
|
||||
uint multisamples;
|
||||
bool ssaa;
|
||||
QtUtils::DecodeMSAAModeValue(m_ui.userMSAAMode->itemData(index), &multisamples, &ssaa);
|
||||
m_game_settings.gpu_multisamples = static_cast<u32>(multisamples);
|
||||
m_game_settings.gpu_per_sample_shading = ssaa;
|
||||
}
|
||||
saveGameSettings();
|
||||
});
|
||||
|
||||
connect(m_ui.userTextureFiltering, QOverload<int>::of(&QComboBox::currentIndexChanged), [this](int index) {
|
||||
if (index <= 0)
|
||||
m_game_settings.gpu_texture_filter.reset();
|
||||
|
@ -633,6 +673,13 @@ void GamePropertiesDialog::connectUi()
|
|||
m_game_settings.gpu_max_run_ahead = static_cast<u32>(value);
|
||||
saveGameSettings();
|
||||
});
|
||||
connect(m_ui.gpuPGXPTolerance, QOverload<double>::of(&QDoubleSpinBox::valueChanged), [this](double value) {
|
||||
if (value < 0.0)
|
||||
m_game_settings.gpu_pgxp_tolerance.reset();
|
||||
else
|
||||
m_game_settings.gpu_pgxp_tolerance = static_cast<float>(value);
|
||||
saveGameSettings();
|
||||
});
|
||||
}
|
||||
|
||||
void GamePropertiesDialog::updateCPUClockSpeedLabel()
|
||||
|
|
|
@ -325,16 +325,26 @@
|
|||
<widget class="QComboBox" name="userResolutionScale"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_24">
|
||||
<property name="text">
|
||||
<string>Multisample Antialiasing:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="userMSAAMode"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_23">
|
||||
<property name="text">
|
||||
<string>Texture Filtering:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="userTextureFiltering"/>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<item row="3" column="0" colspan="2">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="userTrueColor">
|
||||
|
@ -741,6 +751,29 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_28">
|
||||
<property name="text">
|
||||
<string>PGXP Geometry Tolerance:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QDoubleSpinBox" name="gpuPGXPTolerance">
|
||||
<property name="minimum">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>0.5</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
@ -115,7 +115,7 @@ private:
|
|||
enum : u32
|
||||
{
|
||||
GAME_LIST_CACHE_SIGNATURE = 0x45434C47,
|
||||
GAME_LIST_CACHE_VERSION = 14
|
||||
GAME_LIST_CACHE_VERSION = 15
|
||||
};
|
||||
|
||||
using DatabaseMap = std::unordered_map<std::string, GameListDatabaseEntry>;
|
||||
|
|
|
@ -111,11 +111,13 @@ bool Entry::LoadFromStream(ByteStream* stream)
|
|||
!ReadOptionalFromStream(stream, &display_active_end_offset) ||
|
||||
!ReadOptionalFromStream(stream, &dma_max_slice_ticks) || !ReadOptionalFromStream(stream, &dma_halt_ticks) ||
|
||||
!ReadOptionalFromStream(stream, &gpu_fifo_size) || !ReadOptionalFromStream(stream, &gpu_max_run_ahead) ||
|
||||
!ReadOptionalFromStream(stream, &display_crop_mode) || !ReadOptionalFromStream(stream, &display_aspect_ratio) ||
|
||||
!ReadOptionalFromStream(stream, &gpu_pgxp_tolerance) || !ReadOptionalFromStream(stream, &display_crop_mode) ||
|
||||
!ReadOptionalFromStream(stream, &display_aspect_ratio) ||
|
||||
!ReadOptionalFromStream(stream, &display_linear_upscaling) ||
|
||||
!ReadOptionalFromStream(stream, &display_integer_upscaling) ||
|
||||
!ReadOptionalFromStream(stream, &display_force_4_3_for_24bit) ||
|
||||
!ReadOptionalFromStream(stream, &gpu_resolution_scale) || !ReadOptionalFromStream(stream, &gpu_true_color) ||
|
||||
!ReadOptionalFromStream(stream, &gpu_resolution_scale) || !ReadOptionalFromStream(stream, &gpu_multisamples) ||
|
||||
!ReadOptionalFromStream(stream, &gpu_per_sample_shading) || !ReadOptionalFromStream(stream, &gpu_true_color) ||
|
||||
!ReadOptionalFromStream(stream, &gpu_scaled_dithering) ||
|
||||
!ReadOptionalFromStream(stream, &gpu_force_ntsc_timings) ||
|
||||
!ReadOptionalFromStream(stream, &gpu_texture_filter) || !ReadOptionalFromStream(stream, &gpu_widescreen_hack) ||
|
||||
|
@ -156,11 +158,13 @@ bool Entry::SaveToStream(ByteStream* stream) const
|
|||
WriteOptionalToStream(stream, display_active_end_offset) &&
|
||||
WriteOptionalToStream(stream, dma_max_slice_ticks) && WriteOptionalToStream(stream, dma_halt_ticks) &&
|
||||
WriteOptionalToStream(stream, gpu_fifo_size) && WriteOptionalToStream(stream, gpu_max_run_ahead) &&
|
||||
WriteOptionalToStream(stream, display_crop_mode) && WriteOptionalToStream(stream, display_aspect_ratio) &&
|
||||
WriteOptionalToStream(stream, gpu_pgxp_tolerance) && WriteOptionalToStream(stream, display_crop_mode) &&
|
||||
WriteOptionalToStream(stream, display_aspect_ratio) &&
|
||||
WriteOptionalToStream(stream, display_linear_upscaling) &&
|
||||
WriteOptionalToStream(stream, display_integer_upscaling) &&
|
||||
WriteOptionalToStream(stream, display_force_4_3_for_24bit) &&
|
||||
WriteOptionalToStream(stream, gpu_resolution_scale) && WriteOptionalToStream(stream, gpu_true_color) &&
|
||||
WriteOptionalToStream(stream, gpu_resolution_scale) && WriteOptionalToStream(stream, gpu_multisamples) &&
|
||||
WriteOptionalToStream(stream, gpu_per_sample_shading) && WriteOptionalToStream(stream, gpu_true_color) &&
|
||||
WriteOptionalToStream(stream, gpu_scaled_dithering) && WriteOptionalToStream(stream, gpu_force_ntsc_timings) &&
|
||||
WriteOptionalToStream(stream, gpu_texture_filter) && WriteOptionalToStream(stream, gpu_widescreen_hack) &&
|
||||
WriteOptionalToStream(stream, gpu_pgxp) && WriteOptionalToStream(stream, controller_1_type) &&
|
||||
|
@ -209,6 +213,9 @@ static void ParseIniSection(Entry* entry, const char* section, const CSimpleIniA
|
|||
lvalue = ini.GetLongValue(section, "GPUMaxRunAhead", 0);
|
||||
if (lvalue > 0)
|
||||
entry->gpu_max_run_ahead = static_cast<u32>(lvalue);
|
||||
float fvalue = static_cast<float>(ini.GetDoubleValue(section, "GPUPGXPTolerance", -1.0f));
|
||||
if (fvalue >= 0.0f)
|
||||
entry->gpu_pgxp_tolerance = fvalue;
|
||||
|
||||
cvalue = ini.GetValue(section, "DisplayCropMode", nullptr);
|
||||
if (cvalue)
|
||||
|
@ -229,6 +236,12 @@ static void ParseIniSection(Entry* entry, const char* section, const CSimpleIniA
|
|||
cvalue = ini.GetValue(section, "GPUResolutionScale", nullptr);
|
||||
if (cvalue)
|
||||
entry->gpu_resolution_scale = StringUtil::FromChars<u32>(cvalue);
|
||||
cvalue = ini.GetValue(section, "GPUMultisamples", nullptr);
|
||||
if (cvalue)
|
||||
entry->gpu_multisamples = StringUtil::FromChars<u32>(cvalue);
|
||||
cvalue = ini.GetValue(section, "GPUPerSampleShading", nullptr);
|
||||
if (cvalue)
|
||||
entry->gpu_per_sample_shading = StringUtil::FromChars<bool>(cvalue);
|
||||
cvalue = ini.GetValue(section, "GPUTrueColor", nullptr);
|
||||
if (cvalue)
|
||||
entry->gpu_true_color = StringUtil::FromChars<bool>(cvalue);
|
||||
|
@ -302,6 +315,8 @@ static void StoreIniSection(const Entry& entry, const char* section, CSimpleIniA
|
|||
ini.SetLongValue(section, "GPUFIFOSize", static_cast<long>(entry.gpu_fifo_size.value()));
|
||||
if (entry.gpu_max_run_ahead.has_value())
|
||||
ini.SetLongValue(section, "GPUMaxRunAhead", static_cast<long>(entry.gpu_max_run_ahead.value()));
|
||||
if (entry.gpu_pgxp_tolerance.has_value())
|
||||
ini.SetDoubleValue(section, "GPUPGXPTolerance", static_cast<double>(entry.gpu_pgxp_tolerance.value()));
|
||||
|
||||
if (entry.display_crop_mode.has_value())
|
||||
ini.SetValue(section, "DisplayCropMode", Settings::GetDisplayCropModeName(entry.display_crop_mode.value()));
|
||||
|
@ -319,6 +334,10 @@ static void StoreIniSection(const Entry& entry, const char* section, CSimpleIniA
|
|||
|
||||
if (entry.gpu_resolution_scale.has_value())
|
||||
ini.SetLongValue(section, "GPUResolutionScale", static_cast<s32>(entry.gpu_resolution_scale.value()));
|
||||
if (entry.gpu_multisamples.has_value())
|
||||
ini.SetLongValue(section, "GPUMultisamples", static_cast<s32>(entry.gpu_multisamples.value()));
|
||||
if (entry.gpu_per_sample_shading.has_value())
|
||||
ini.SetValue(section, "GPUPerSampleShading", entry.gpu_per_sample_shading.value() ? "true" : "false");
|
||||
if (entry.gpu_true_color.has_value())
|
||||
ini.SetValue(section, "GPUTrueColor", entry.gpu_true_color.value() ? "true" : "false");
|
||||
if (entry.gpu_scaled_dithering.has_value())
|
||||
|
@ -475,6 +494,8 @@ void Entry::ApplySettings(bool display_osd_messages) const
|
|||
g_settings.gpu_fifo_size = gpu_fifo_size.value();
|
||||
if (gpu_max_run_ahead.has_value())
|
||||
g_settings.gpu_max_run_ahead = gpu_max_run_ahead.value();
|
||||
if (gpu_pgxp_tolerance.has_value())
|
||||
g_settings.gpu_pgxp_tolerance = gpu_pgxp_tolerance.value();
|
||||
|
||||
if (display_crop_mode.has_value())
|
||||
g_settings.display_crop_mode = display_crop_mode.value();
|
||||
|
@ -489,6 +510,10 @@ void Entry::ApplySettings(bool display_osd_messages) const
|
|||
|
||||
if (gpu_resolution_scale.has_value())
|
||||
g_settings.gpu_resolution_scale = gpu_resolution_scale.value();
|
||||
if (gpu_multisamples.has_value())
|
||||
g_settings.gpu_multisamples = gpu_multisamples.value();
|
||||
if (gpu_per_sample_shading.has_value())
|
||||
g_settings.gpu_per_sample_shading = gpu_per_sample_shading.value();
|
||||
if (gpu_true_color.has_value())
|
||||
g_settings.gpu_true_color = gpu_true_color.value();
|
||||
if (gpu_scaled_dithering.has_value())
|
||||
|
|
|
@ -42,6 +42,7 @@ struct Entry
|
|||
std::optional<u32> dma_halt_ticks;
|
||||
std::optional<u32> gpu_fifo_size;
|
||||
std::optional<u32> gpu_max_run_ahead;
|
||||
std::optional<float> gpu_pgxp_tolerance;
|
||||
|
||||
// user settings
|
||||
std::optional<u32> cpu_overclock_numerator;
|
||||
|
@ -54,6 +55,8 @@ struct Entry
|
|||
std::optional<bool> display_integer_upscaling;
|
||||
std::optional<bool> display_force_4_3_for_24bit;
|
||||
std::optional<u32> gpu_resolution_scale;
|
||||
std::optional<u32> gpu_multisamples;
|
||||
std::optional<bool> gpu_per_sample_shading;
|
||||
std::optional<bool> gpu_true_color;
|
||||
std::optional<bool> gpu_scaled_dithering;
|
||||
std::optional<bool> gpu_force_ntsc_timings;
|
||||
|
|
Loading…
Reference in a new issue