GS/HW: Add debug blend setting.

Will enable SW blend and disable many optimizations.
This commit is contained in:
TJnotJT
2026-05-13 19:49:07 +02:00
committed by lightningterror
parent 3233a3cf8f
commit c1cb214a03
7 changed files with 31 additions and 15 deletions
@@ -321,6 +321,13 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="useDebugBlend">
<property name="text">
<string>Use Debug Blend</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
@@ -355,6 +362,7 @@
<tabstop>palFrameRate</tabstop>
<tabstop>overrideTextureBarriers</tabstop>
<tabstop>useDebugDevice</tabstop>
<tabstop>useDebugBlend</tabstop>
<tabstop>disableFramebufferFetch</tabstop>
<tabstop>disableShaderCache</tabstop>
<tabstop>disableVertexShaderExpand</tabstop>
@@ -225,6 +225,7 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* settings_dialog,
//////////////////////////////////////////////////////////////////////////
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_advanced.useBlitSwapChain, "EmuCore/GS", "UseBlitSwapChain", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_advanced.useDebugDevice, "EmuCore/GS", "UseDebugDevice", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_advanced.useDebugBlend, "EmuCore/GS", "UseDebugBlend", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_advanced.disableMailboxPresentation, "EmuCore/GS", "DisableMailboxPresentation", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_advanced.extendedUpscales, "EmuCore/GS", "ExtendedUpscalingMultipliers", false);
SettingWidgetBinder::BindWidgetToIntSetting(sif, m_advanced.exclusiveFullscreenControl, "EmuCore/GS", "ExclusiveFullscreenControl", -1, -1);
@@ -766,6 +767,9 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* settings_dialog,
dialog()->registerWidgetHelp(m_advanced.useDebugDevice, tr("Enable Debug Device"), tr("Unchecked"),
tr("Enables API-level validation of graphics commands."));
dialog()->registerWidgetHelp(m_advanced.useDebugBlend, tr("Enable Debug Blend"), tr("Unchecked"),
tr("Forces SW blending and disables several optimizations."));
dialog()->registerWidgetHelp(m_advanced.gsDownloadMode, tr("GS Download Mode"), tr("Accurate"),
tr("Skips synchronizing with the GS thread and host GPU for GS downloads. "
"Can result in a large speed boost on slower systems, at the cost of many broken graphical effects. "
+2 -1
View File
@@ -760,6 +760,7 @@ struct Pcsx2Config
PCRTCOverscan : 1,
IntegerScaling : 1,
UseDebugDevice : 1,
UseDebugBlend : 1,
UseBlitSwapChain : 1,
DisableShaderCache : 1,
DisableFramebufferFetch : 1,
@@ -791,7 +792,7 @@ struct Pcsx2Config
PreloadFrameWithGSData : 1,
Mipmap : 1,
HWMipmap : 1,
HWAccurateAlphaTest: 1,
HWAccurateAlphaTest : 1,
HWAA1 : 1,
ManualUserHacks : 1,
UserHacks_AlignSpriteX : 1,
+2 -2
View File
@@ -4642,13 +4642,13 @@ GSState::PRIM_OVERLAP GSState::GetPrimitiveOverlapDrawlistImpl(bool save_drawlis
};
// First check: see if the triangles are part of a triangle strip.
if (!got_bbox && !using_aa1)
if (!got_bbox && !using_aa1 && !GSConfig.UseDebugBlend)
{
got_bbox = CheckTriangleStrips(j, skip, bbox, saved_tristrip);
}
// Second check: see if the triangles are part of triangle fan.
if (!got_bbox && !using_aa1)
if (!got_bbox && !using_aa1 && !GSConfig.UseDebugBlend)
{
got_bbox = CheckTriangleQuads.template operator()<1>(j, skip, bbox);
}
+11 -12
View File
@@ -6955,27 +6955,26 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, DATEOptio
break;
}
if (features.framebuffer_fetch)
{
const bool force_sw_blending =
// If we have fbfetch, use software blending when we need the fb value for anything else.
// This saves outputting the second color when it's not needed.
if (one_barrier || m_conf.require_full_barrier)
{
sw_blending = true;
color_dest_blend = false;
accumulation_blend = false;
blend_mix = false;
}
}
(features.framebuffer_fetch && (one_barrier || m_conf.require_full_barrier)) ||
if (m_conf.ps.IsFeedbackLoopDepth() && !features.depth_feedback)
{
// If we are doing depth feedback with a second RT we must use SW blending to avoid
// mixing dual source blending with multiple render targets.
(m_conf.ps.IsFeedbackLoopDepth() && !features.depth_feedback) ||
// Force SW blending with barriers.
GSConfig.UseDebugBlend;
if (force_sw_blending)
{
sw_blending = true;
color_dest_blend = false;
accumulation_blend = false;
blend_mix = false;
color_dest_blend2 = false;
blend_zero_to_one_range = false;
}
// Color clip
+2
View File
@@ -4979,6 +4979,8 @@ void FullscreenUI::DrawAdvancedSettingsPage()
MenuHeading(FSUI_CSTR("Graphics"));
DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_BUG, "Use Debug Device"), FSUI_CSTR("Enables API-level validation of graphics commands."), "EmuCore/GS",
"UseDebugDevice", false);
DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_BUG, "Use Debug Blend"), FSUI_CSTR("Forces SW blending and disables several optimizations."), "EmuCore/GS", "UseDebugBlend", false);
}
EndMenuButtons();
+2
View File
@@ -754,6 +754,7 @@ Pcsx2Config::GSOptions::GSOptions()
HWMipmap = true;
HWAccurateAlphaTest = false;
HWAA1 = false;
UseDebugBlend = false;
ManualUserHacks = false;
UserHacks_AlignSpriteX = false;
@@ -1041,6 +1042,7 @@ void Pcsx2Config::GSOptions::LoadSave(SettingsWrapper& wrap)
SettingsWrapBitBoolEx(HWMipmap, "hw_mipmap");
SettingsWrapBitBool(HWAccurateAlphaTest);
SettingsWrapBitBool(HWAA1);
SettingsWrapBitBool(UseDebugBlend);
SettingsWrapIntEnumEx(AccurateBlendingUnit, "accurate_blending_unit");
SettingsWrapIntEnumEx(TextureFiltering, "filter");
SettingsWrapIntEnumEx(TexturePreloading, "texture_preloading");