From 37b19495a85adf5b8ace193882d96fc5e5dbbea1 Mon Sep 17 00:00:00 2001 From: lightningterror <18107717+lightningterror@users.noreply.github.com> Date: Tue, 21 Feb 2023 17:48:02 +0100 Subject: [PATCH] GS-hw: Use rgb color for second output instead of alpha. We want different alpha value for each channel. --- pcsx2/GS/Renderers/Common/GSDevice.h | 4 ++-- pcsx2/GS/Renderers/HW/GSRendererHW.cpp | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pcsx2/GS/Renderers/Common/GSDevice.h b/pcsx2/GS/Renderers/Common/GSDevice.h index c7624a98be..959697f9a7 100644 --- a/pcsx2/GS/Renderers/Common/GSDevice.h +++ b/pcsx2/GS/Renderers/Common/GSDevice.h @@ -858,8 +858,8 @@ public: __fi static constexpr bool IsDualSourceBlendFactor(u8 factor) { - return (factor == SRC1_ALPHA || factor == INV_SRC1_ALPHA - /*|| factor == SRC1_COLOR || factor == INV_SRC1_COLOR*/); // not used + return (factor == SRC1_ALPHA || factor == INV_SRC1_ALPHA || factor == SRC1_COLOR + /* || factor == INV_SRC1_COLOR*/); // not used } __fi static constexpr bool IsConstantBlendFactor(u16 factor) { diff --git a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp index 0034c1b9f9..f624cdd97d 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp +++ b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp @@ -3088,10 +3088,9 @@ void GSRendererHW::EmulateBlending(bool& DATE_PRIMID, bool& DATE_BARRIER, bool& // Replace Cs*F + Cd*(1 - F) with Cs*F - Cd*(F - 1). // As - 1 or F - 1 subtraction is only done for the dual source output (hw blending part) since we are changing the equation. // Af will be replaced with As in shader and send it to dual source output. - m_conf.blend = {true, GSDevice::CONST_ONE, GSDevice::SRC1_ALPHA, GSDevice::OP_SUBTRACT, false, 0}; + m_conf.blend = {true, GSDevice::CONST_ONE, GSDevice::SRC1_COLOR, GSDevice::OP_SUBTRACT, false, 0}; // clr_hw 1 will disable alpha clamp, we can reuse the old bits. m_conf.ps.clr_hw = 1; - //m_conf.ps.blend_mix = 0; // DSB output will always be used. m_conf.ps.no_color1 = false; }