GS: Add automatic trilinear filtering level

This commit is contained in:
Connor McLaughlin 2022-03-25 22:51:45 +10:00 committed by refractionpcsx2
parent bc7ed4e7d0
commit 1b83e17d60
7 changed files with 21 additions and 8 deletions

View File

@ -133,7 +133,7 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsDialog* dialog, QWidget*
SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.upscaleMultiplier, "EmuCore/GS", "upscale_multiplier", 1, 1); SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.upscaleMultiplier, "EmuCore/GS", "upscale_multiplier", 1, 1);
SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.textureFiltering, "EmuCore/GS", "filter", static_cast<int>(BiFiltering::PS2)); SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.textureFiltering, "EmuCore/GS", "filter", static_cast<int>(BiFiltering::PS2));
SettingWidgetBinder::BindWidgetToIntSetting( SettingWidgetBinder::BindWidgetToIntSetting(
sif, m_ui.trilinearFiltering, "EmuCore/GS", "UserHacks_TriFilter", static_cast<int>(TriFiltering::Off)); sif, m_ui.trilinearFiltering, "EmuCore/GS", "UserHacks_TriFilter", static_cast<int>(TriFiltering::Automatic), -1);
SettingWidgetBinder::BindWidgetToEnumSetting( SettingWidgetBinder::BindWidgetToEnumSetting(
sif, m_ui.anisotropicFiltering, "EmuCore/GS", "MaxAnisotropy", s_anisotropic_filtering_entries, s_anisotropic_filtering_values, "1"); sif, m_ui.anisotropicFiltering, "EmuCore/GS", "MaxAnisotropy", s_anisotropic_filtering_entries, s_anisotropic_filtering_values, "1");
SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.dithering, "EmuCore/GS", "dithering_ps2", 2); SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.dithering, "EmuCore/GS", "dithering_ps2", 2);

View File

@ -422,7 +422,12 @@
<widget class="QComboBox" name="trilinearFiltering"> <widget class="QComboBox" name="trilinearFiltering">
<item> <item>
<property name="text"> <property name="text">
<string>None (Default)</string> <string>Automatic (Default)</string>
</property>
</item>
<item>
<property name="text">
<string>Off (None)</string>
</property> </property>
</item> </item>
<item> <item>

View File

@ -146,8 +146,9 @@ enum class BiFiltering : u8
Forced_But_Sprite, Forced_But_Sprite,
}; };
enum class TriFiltering : u8 enum class TriFiltering : s8
{ {
Automatic = -1,
Off, Off,
PS2, PS2,
Forced, Forced,
@ -525,7 +526,7 @@ struct Pcsx2Config
int UserHacks_RoundSprite{0}; int UserHacks_RoundSprite{0};
int UserHacks_TCOffsetX{0}; int UserHacks_TCOffsetX{0};
int UserHacks_TCOffsetY{0}; int UserHacks_TCOffsetY{0};
TriFiltering UserHacks_TriFilter{TriFiltering::Off}; TriFiltering UserHacks_TriFilter{TriFiltering::Automatic};
int OverrideTextureBarriers{-1}; int OverrideTextureBarriers{-1};
int OverrideGeometryShaders{-1}; int OverrideGeometryShaders{-1};

View File

@ -1242,7 +1242,8 @@ void GSApp::Init()
m_gs_bifilter.push_back(GSSetting(static_cast<u32>(BiFiltering::Forced), "Bilinear", "Forced")); m_gs_bifilter.push_back(GSSetting(static_cast<u32>(BiFiltering::Forced), "Bilinear", "Forced"));
m_gs_bifilter.push_back(GSSetting(static_cast<u32>(BiFiltering::PS2), "Bilinear", "PS2")); m_gs_bifilter.push_back(GSSetting(static_cast<u32>(BiFiltering::PS2), "Bilinear", "PS2"));
m_gs_trifilter.push_back(GSSetting(static_cast<u32>(TriFiltering::Off), "None", "Default")); m_gs_trifilter.push_back(GSSetting(static_cast<u32>(TriFiltering::Automatic), "Automatic", "Default"));
m_gs_trifilter.push_back(GSSetting(static_cast<u32>(TriFiltering::Off), "None", ""));
m_gs_trifilter.push_back(GSSetting(static_cast<u32>(TriFiltering::PS2), "Trilinear", "")); m_gs_trifilter.push_back(GSSetting(static_cast<u32>(TriFiltering::PS2), "Trilinear", ""));
m_gs_trifilter.push_back(GSSetting(static_cast<u32>(TriFiltering::Forced), "Trilinear", "Ultra/Slow")); m_gs_trifilter.push_back(GSSetting(static_cast<u32>(TriFiltering::Forced), "Trilinear", "Ultra/Slow"));
@ -1413,7 +1414,7 @@ void GSApp::Init()
m_default_configuration["UserHacks_TCOffsetX"] = "0"; m_default_configuration["UserHacks_TCOffsetX"] = "0";
m_default_configuration["UserHacks_TCOffsetY"] = "0"; m_default_configuration["UserHacks_TCOffsetY"] = "0";
m_default_configuration["UserHacks_TextureInsideRt"] = "0"; m_default_configuration["UserHacks_TextureInsideRt"] = "0";
m_default_configuration["UserHacks_TriFilter"] = std::to_string(static_cast<s8>(TriFiltering::Off)); m_default_configuration["UserHacks_TriFilter"] = std::to_string(static_cast<s8>(TriFiltering::Automatic));
m_default_configuration["UserHacks_WildHack"] = "0"; m_default_configuration["UserHacks_WildHack"] = "0";
m_default_configuration["wrap_gs_mem"] = "0"; m_default_configuration["wrap_gs_mem"] = "0";
m_default_configuration["vsync"] = "0"; m_default_configuration["vsync"] = "0";

View File

@ -1067,6 +1067,7 @@ void GSRendererNew::EmulateTextureSampler(const GSTextureCache::Source* tex)
} }
break; break;
case TriFiltering::Automatic:
case TriFiltering::Off: case TriFiltering::Off:
default: default:
break; break;

View File

@ -408,7 +408,12 @@ u32 GameDatabaseSchema::GameEntry::applyGSHardwareFixes(Pcsx2Config::GSOptions&
case GSHWFixId::TrilinearFiltering: case GSHWFixId::TrilinearFiltering:
{ {
if (value >= 0 && value <= static_cast<int>(TriFiltering::Forced)) if (value >= 0 && value <= static_cast<int>(TriFiltering::Forced))
{
if (config.UserHacks_TriFilter == TriFiltering::Automatic)
config.UserHacks_TriFilter = static_cast<TriFiltering>(value); config.UserHacks_TriFilter = static_cast<TriFiltering>(value);
else if (config.UserHacks_TriFilter == TriFiltering::Off)
Console.Warning("[GameDB] Game requires trilinear filtering but it has been force disabled.");
}
} }
break; break;

View File

@ -630,7 +630,7 @@ void Pcsx2Config::GSOptions::MaskUserHacks()
// in wx, we put trilinear filtering behind user hacks, but not in qt. // in wx, we put trilinear filtering behind user hacks, but not in qt.
#ifndef PCSX2_CORE #ifndef PCSX2_CORE
UserHacks_TriFilter = TriFiltering::Off; UserHacks_TriFilter = TriFiltering::Automatic;
#endif #endif
} }