code: Add texture sampling option (#7118)

* This replaces the nearest neighbour filter that shouldn't have existed in the first place
This commit is contained in:
GPUCode 2023-11-23 02:04:47 +02:00 committed by GitHub
parent c17ec1d1aa
commit 85bd1be852
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 110 additions and 59 deletions

View file

@ -184,11 +184,6 @@
<string>Bicubic</string>
</property>
</item>
<item>
<property name="text">
<string>Nearest Neighbor</string>
</property>
</item>
<item>
<property name="text">
<string>ScaleForce</string>
@ -199,11 +194,11 @@
<string>xBRZ</string>
</property>
</item>
<item>
<property name="text">
<string>MMPX</string>
</property>
</item>
<item>
<property name="text">
<string>MMPX</string>
</property>
</item>
</widget>
</item>
</layout>

View file

@ -71,11 +71,17 @@ void ConfigureGraphics::SetConfiguration() {
!Settings::values.physical_device.UsingGlobal());
ConfigurationShared::SetPerGameSetting(ui->physical_device_combo,
&Settings::values.physical_device);
ConfigurationShared::SetPerGameSetting(ui->texture_sampling_combobox,
&Settings::values.texture_sampling);
ConfigurationShared::SetHighlight(ui->widget_texture_sampling,
!Settings::values.texture_sampling.UsingGlobal());
} else {
ui->graphics_api_combo->setCurrentIndex(
static_cast<int>(Settings::values.graphics_api.GetValue()));
ui->physical_device_combo->setCurrentIndex(
static_cast<int>(Settings::values.physical_device.GetValue()));
ui->texture_sampling_combobox->setCurrentIndex(
static_cast<int>(Settings::values.texture_sampling.GetValue()));
}
ui->toggle_hw_shader->setChecked(Settings::values.use_hw_shader.GetValue());
@ -106,6 +112,8 @@ void ConfigureGraphics::ApplyConfiguration() {
use_hw_shader);
ConfigurationShared::ApplyPerGameSetting(&Settings::values.shaders_accurate_mul,
ui->toggle_accurate_mul, shaders_accurate_mul);
ConfigurationShared::ApplyPerGameSetting(&Settings::values.texture_sampling,
ui->texture_sampling_combobox);
ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_disk_shader_cache,
ui->toggle_disk_shader_cache, use_disk_shader_cache);
ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_vsync_new, ui->toggle_vsync_new,
@ -132,6 +140,7 @@ void ConfigureGraphics::SetupPerGameUI() {
Settings::values.use_vsync_new.UsingGlobal());
ui->toggle_async_shaders->setEnabled(
Settings::values.async_shader_compilation.UsingGlobal());
ui->widget_texture_sampling->setEnabled(Settings::values.texture_sampling.UsingGlobal());
ui->toggle_async_present->setEnabled(Settings::values.async_presentation.UsingGlobal());
ui->graphics_api_combo->setEnabled(Settings::values.graphics_api.UsingGlobal());
ui->physical_device_combo->setEnabled(Settings::values.physical_device.UsingGlobal());
@ -148,6 +157,10 @@ void ConfigureGraphics::SetupPerGameUI() {
ui->physical_device_combo, ui->physical_device_group,
static_cast<u32>(Settings::values.physical_device.GetValue(true)));
ConfigurationShared::SetColoredComboBox(
ui->texture_sampling_combobox, ui->widget_texture_sampling,
static_cast<int>(Settings::values.texture_sampling.GetValue(true)));
ConfigurationShared::SetColoredTristate(ui->toggle_hw_shader, Settings::values.use_hw_shader,
use_hw_shader);
ConfigurationShared::SetColoredTristate(

View file

@ -212,6 +212,53 @@
<string>Advanced</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QWidget" name="widget_texture_sampling" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_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="QLabel" name="texture_sampling_label">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Overrides the sampling filter used by games. This can be useful in certain cases with poorly behaved games when upscaling. If unsure set this to Game Controlled&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Texture Sampling</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="texture_sampling_combobox">
<item>
<property name="text">
<string>Game Controlled</string>
</property>
</item>
<item>
<property name="text">
<string>Nearest Neighbor</string>
</property>
</item>
<item>
<property name="text">
<string>Linear</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="toggle_disk_shader_cache">
<property name="toolTip">