diff --git a/pcsx2-qt/Settings/GraphicsAdvancedSettingsTab.ui b/pcsx2-qt/Settings/GraphicsAdvancedSettingsTab.ui index b91e749d31..aac9621e11 100644 --- a/pcsx2-qt/Settings/GraphicsAdvancedSettingsTab.ui +++ b/pcsx2-qt/Settings/GraphicsAdvancedSettingsTab.ui @@ -321,6 +321,13 @@ + + + + Use Debug Blend + + + @@ -355,6 +362,7 @@ palFrameRate overrideTextureBarriers useDebugDevice + useDebugBlend disableFramebufferFetch disableShaderCache disableVertexShaderExpand diff --git a/pcsx2-qt/Settings/GraphicsSettingsWidget.cpp b/pcsx2-qt/Settings/GraphicsSettingsWidget.cpp index a71099d571..14a094144c 100644 --- a/pcsx2-qt/Settings/GraphicsSettingsWidget.cpp +++ b/pcsx2-qt/Settings/GraphicsSettingsWidget.cpp @@ -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. " diff --git a/pcsx2/Config.h b/pcsx2/Config.h index f338cead3c..cc67c55fa6 100644 --- a/pcsx2/Config.h +++ b/pcsx2/Config.h @@ -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, diff --git a/pcsx2/GS/GSState.cpp b/pcsx2/GS/GSState.cpp index c55cd731a5..8175653a2d 100644 --- a/pcsx2/GS/GSState.cpp +++ b/pcsx2/GS/GSState.cpp @@ -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); } diff --git a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp index 5cb178873b..517834bd20 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp +++ b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp @@ -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 diff --git a/pcsx2/ImGui/FullscreenUI_Settings.cpp b/pcsx2/ImGui/FullscreenUI_Settings.cpp index 2ebc17d981..17d1af3116 100644 --- a/pcsx2/ImGui/FullscreenUI_Settings.cpp +++ b/pcsx2/ImGui/FullscreenUI_Settings.cpp @@ -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(); diff --git a/pcsx2/Pcsx2Config.cpp b/pcsx2/Pcsx2Config.cpp index 18a00d98c4..48df8c2503 100644 --- a/pcsx2/Pcsx2Config.cpp +++ b/pcsx2/Pcsx2Config.cpp @@ -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");