GPU/HW: Support using ROV for accurate blending

This commit is contained in:
Stenzek
2024-07-22 01:12:33 +10:00
parent 1006fa00da
commit 2a617c505a
15 changed files with 639 additions and 286 deletions

View File

@ -138,6 +138,7 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget*
"UseSoftwareRendererForReadbacks", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.forceRoundedTexcoords, "GPU", "ForceRoundTextureCoordinates",
false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.accurateBlending, "GPU", "AccurateBlending", false);
SettingWidgetBinder::SetAvailability(m_ui.scaledDithering,
!m_dialog->hasGameTrait(GameDatabase::Trait::DisableScaledDithering));
@ -388,6 +389,10 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget*
m_ui.forceRoundedTexcoords, tr("Round Upscaled Texture Coordinates"), tr("Unchecked"),
tr("Rounds texture coordinates instead of flooring when upscaling. Can fix misaligned textures in some games, but "
"break others, and is incompatible with texture filtering."));
dialog->registerWidgetHelp(
m_ui.accurateBlending, tr("Accurate Blending"), tr("Unchecked"),
tr("Forces blending to be done in the shader at 16-bit precision, when not using true color. Very few games "
"actually require this, and there is a <strong>non-trivial</strong> performance cost."));
// PGXP Tab
@ -520,6 +525,12 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget*
dialog->registerWidgetHelp(m_ui.disableTextureCopyToSelf, tr("Disable Texture Copies To Self"), tr("Unchecked"),
tr("Disables the use of self-copy updates for the VRAM texture. Useful for testing broken "
"graphics drivers. <strong>Only for developer use.</strong>"));
dialog->registerWidgetHelp(m_ui.disableMemoryImport, tr("Disable Memory Import"), tr("Unchecked"),
tr("Disables the use of host memory importing. Useful for testing broken graphics "
"drivers. <strong>Only for developer use.</strong>"));
dialog->registerWidgetHelp(m_ui.disableRasterOrderViews, tr("Disable Rasterizer Order Views"), tr("Unchecked"),
tr("Disables the use of rasterizer order views. Useful for testing broken graphics "
"drivers. <strong>Only for developer use.</strong>"));
}
GraphicsSettingsWidget::~GraphicsSettingsWidget() = default;
@ -669,6 +680,8 @@ void GraphicsSettingsWidget::updateRendererDependentOptions()
m_ui.debanding->setEnabled(is_hardware);
m_ui.scaledDithering->setEnabled(is_hardware && !m_dialog->hasGameTrait(GameDatabase::Trait::DisableScaledDithering));
m_ui.useSoftwareRendererForReadbacks->setEnabled(is_hardware);
m_ui.forceRoundedTexcoords->setEnabled(is_hardware);
m_ui.accurateBlending->setEnabled(is_hardware);
m_ui.tabs->setTabEnabled(TAB_INDEX_TEXTURE_REPLACEMENTS, is_hardware);
@ -881,9 +894,9 @@ void GraphicsSettingsWidget::onTrueColorChanged()
const bool true_color = m_dialog->getEffectiveBoolValue("GPU", "TrueColor", false);
const bool allow_scaled_dithering =
(resolution_scale != 1 && !true_color && !m_dialog->hasGameTrait(GameDatabase::Trait::DisableScaledDithering));
const bool allow_debanding = true_color;
m_ui.scaledDithering->setEnabled(allow_scaled_dithering);
m_ui.debanding->setEnabled(allow_debanding);
m_ui.debanding->setEnabled(true_color);
m_ui.accurateBlending->setEnabled(!true_color);
}
void GraphicsSettingsWidget::onDownsampleModeChanged()

View File

@ -392,13 +392,6 @@
</item>
<item row="2" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout_5">
<item row="1" column="0">
<widget class="QCheckBox" name="gpuThread">
<property name="text">
<string>Threaded Rendering</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="scaledDithering">
<property name="text">
@ -406,13 +399,6 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="useSoftwareRendererForReadbacks">
<property name="text">
<string>Software Renderer Readbacks</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="debanding">
<property name="text">
@ -420,13 +406,34 @@
</property>
</widget>
</item>
<item row="2" column="0">
<item row="2" column="1">
<widget class="QCheckBox" name="useSoftwareRendererForReadbacks">
<property name="text">
<string>Software Renderer Readbacks</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="forceRoundedTexcoords">
<property name="text">
<string>Round Upscaled Texture Coordinates</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="gpuThread">
<property name="text">
<string>Threaded Rendering</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="accurateBlending">
<property name="text">
<string>Accurate Blending</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
@ -993,13 +1000,6 @@
<layout class="QFormLayout" name="formLayout_10">
<item row="0" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout_8">
<item row="1" column="1">
<widget class="QCheckBox" name="disableFramebufferFetch">
<property name="text">
<string>Disable Framebuffer Fetch</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="disableTextureCopyToSelf">
<property name="text">
@ -1007,13 +1007,6 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="disableDualSource">
<property name="text">
<string>Disable Dual-Source Blending</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="useDebugDevice">
<property name="text">
@ -1021,10 +1014,17 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="disableShaderCache">
<item row="1" column="0">
<widget class="QCheckBox" name="disableDualSource">
<property name="text">
<string>Disable Shader Cache</string>
<string>Disable Dual-Source Blending</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="disableFramebufferFetch">
<property name="text">
<string>Disable Framebuffer Fetch</string>
</property>
</widget>
</item>
@ -1035,6 +1035,27 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="disableShaderCache">
<property name="text">
<string>Disable Shader Cache</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="disableMemoryImport">
<property name="text">
<string>Disable Memory Import</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="disableRasterOrderViews">
<property name="text">
<string>Disable Rasterizer Order Views</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>