diff --git a/pcsx2/GS/Renderers/Common/GSDevice.h b/pcsx2/GS/Renderers/Common/GSDevice.h index ae0d0904cfeda..ba18334f68521 100644 --- a/pcsx2/GS/Renderers/Common/GSDevice.h +++ b/pcsx2/GS/Renderers/Common/GSDevice.h @@ -701,6 +701,7 @@ struct alignas(16) GSHWDrawConfig { BlendState blend; u8 blend_hw; + u8 dither; bool enable; }; static_assert(sizeof(BlendPass) == 8, "blend pass is 8 bytes"); diff --git a/pcsx2/GS/Renderers/DX11/GSDevice11.cpp b/pcsx2/GS/Renderers/DX11/GSDevice11.cpp index ed876169d21de..fa55574974ff3 100644 --- a/pcsx2/GS/Renderers/DX11/GSDevice11.cpp +++ b/pcsx2/GS/Renderers/DX11/GSDevice11.cpp @@ -2627,6 +2627,7 @@ void GSDevice11::RenderHW(GSHWDrawConfig& config) if (config.blend_second_pass.enable) { config.ps.blend_hw = config.blend_second_pass.blend_hw; + config.ps.dither = config.blend_second_pass.dither; SetupPS(config.ps, &config.cb_ps, config.sampler); SetupOM(config.depth, OMBlendSelector(config.colormask, config.blend_second_pass.blend), config.blend_second_pass.blend.constant); DrawIndexedPrimitive(); diff --git a/pcsx2/GS/Renderers/DX12/GSDevice12.cpp b/pcsx2/GS/Renderers/DX12/GSDevice12.cpp index c8de3ef6f29fe..46d1cf7d23acd 100644 --- a/pcsx2/GS/Renderers/DX12/GSDevice12.cpp +++ b/pcsx2/GS/Renderers/DX12/GSDevice12.cpp @@ -3950,6 +3950,7 @@ void GSDevice12::RenderHW(GSHWDrawConfig& config) pipe.bs = config.blend_second_pass.blend; pipe.ps.blend_hw = config.blend_second_pass.blend_hw; + pipe.ps.dither = config.blend_second_pass.dither; if (BindDrawPipeline(pipe)) DrawIndexedPrimitive(); } diff --git a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp index a4c341d37161f..5eb5455f1014a 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp +++ b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp @@ -4443,14 +4443,17 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, bool& DAT { // Alpha = As or Af. // Cs + Cd*Alpha, Cs - Cd*Alpha. + const u8 dither = m_conf.ps.dither; // Render pass 1: Calculate Cd*Alpha with an alpha range of 0-2. m_conf.ps.blend_hw = 2; + m_conf.ps.dither = 0; blend.src = GSDevice::DST_COLOR; blend.dst = (m_conf.ps.blend_c == 2) ? GSDevice::CONST_COLOR : GSDevice::SRC1_COLOR; blend.op = GSDevice::OP_ADD; // Render pass 2: Add or subtract result of render pass 1(Cd) from Cs. m_conf.blend_second_pass.enable = true; m_conf.blend_second_pass.blend_hw = 0; + m_conf.blend_second_pass.dither = dither; m_conf.blend_second_pass.blend = {true, blend_second_pass.src, GSDevice::CONST_ONE, blend_second_pass.op, GSDevice::CONST_ONE, GSDevice::CONST_ZERO, false, 0}; } else if (alpha_c1_high_no_rta_correct && (blend_flag & BLEND_HW5)) diff --git a/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp b/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp index 14c6eae36c6ab..43ec942a60d45 100644 --- a/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp +++ b/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp @@ -2587,6 +2587,7 @@ void GSDeviceOGL::RenderHW(GSHWDrawConfig& config) OMSetBlendState(); } psel.ps.blend_hw = config.blend_second_pass.blend_hw; + psel.ps.dither = config.blend_second_pass.dither; SetupPipeline(psel); SendHWDraw(config, psel.ps.IsFeedbackLoop()); } diff --git a/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp b/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp index 1e80ce51eff1a..6625f35d32947 100644 --- a/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp +++ b/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp @@ -5844,6 +5844,7 @@ void GSDeviceVK::RenderHW(GSHWDrawConfig& config) pipe.bs = config.blend_second_pass.blend; pipe.ps.blend_hw = config.blend_second_pass.blend_hw; + pipe.ps.dither = config.blend_second_pass.dither; if (BindDrawPipeline(pipe)) DrawIndexedPrimitive(); }