diff --git a/pcsx2/GS/Renderers/DX11/GSDevice11.cpp b/pcsx2/GS/Renderers/DX11/GSDevice11.cpp index 1b428f532c..20b5c8f1b6 100644 --- a/pcsx2/GS/Renderers/DX11/GSDevice11.cpp +++ b/pcsx2/GS/Renderers/DX11/GSDevice11.cpp @@ -3306,6 +3306,16 @@ void GSDevice11::RenderHW(GSHWDrawConfig& config) SetupOM(config.alpha_second_pass.depth, OMBlendSelector(config.alpha_second_pass.colormask, config.blend), config.blend.constant); SendHWDraw(config, rt_feedbackloop_pass2 ? draw_rt_clone : nullptr, draw_rt, ds_feedbackloop_pass2 ? draw_ds_clone : nullptr, draw_ds_as_rt ? draw_ds_as_rt : draw_ds, one_barrier, config.alpha_second_pass.require_full_barrier, rtsize); + + if (config.blend_multi_pass.enable) + { + config.alpha_second_pass.ps.no_color1 = config.blend_multi_pass.no_color1; + config.alpha_second_pass.ps.blend_hw = config.blend_multi_pass.blend_hw; + config.alpha_second_pass.ps.dither = config.blend_multi_pass.dither; + SetupPS(config.alpha_second_pass.ps, &config.cb_ps, config.sampler); + SetupOM(config.alpha_second_pass.depth, OMBlendSelector(config.alpha_second_pass.colormask, config.blend_multi_pass.blend), config.blend_multi_pass.blend.constant); + Draw(config); + } } if (colclip_rt) diff --git a/pcsx2/GS/Renderers/DX12/GSDevice12.cpp b/pcsx2/GS/Renderers/DX12/GSDevice12.cpp index c3b8cc3ba6..0152ce34d1 100644 --- a/pcsx2/GS/Renderers/DX12/GSDevice12.cpp +++ b/pcsx2/GS/Renderers/DX12/GSDevice12.cpp @@ -4746,7 +4746,7 @@ void GSDevice12::RenderHW(GSHWDrawConfig& config) SendHWDraw(pipe, config, draw_rt, draw_ds_as_rt, draw_rt_rov, draw_ds_rov, feedback_rt, feedback_depth, config.require_one_barrier, config.require_full_barrier); - // blend second pass + // blend multi pass if (config.blend_multi_pass.enable) { if (config.blend_multi_pass.blend.constant_enable) @@ -4777,6 +4777,20 @@ void GSDevice12::RenderHW(GSHWDrawConfig& config) SendHWDraw(pipe, config, draw_rt, draw_ds_as_rt, draw_rt_rov, draw_ds_rov, feedback_rt, feedback_depth, config.alpha_second_pass.require_one_barrier, config.alpha_second_pass.require_full_barrier); + + // blend multi pass with alpha second pass + if (config.blend_multi_pass.enable) + { + if (config.blend_multi_pass.blend.constant_enable) + SetBlendConstants(config.blend_multi_pass.blend.constant); + + pipe.bs = config.blend_multi_pass.blend; + pipe.ps.no_color1 = config.blend_multi_pass.no_color1; + pipe.ps.blend_hw = config.blend_multi_pass.blend_hw; + pipe.ps.dither = config.blend_multi_pass.dither; + if (BindDrawPipeline(pipe)) + Draw(config); + } } if (date_image) diff --git a/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp b/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp index 512f3b04cf..dee2a4bde9 100644 --- a/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp +++ b/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp @@ -3393,6 +3393,26 @@ void GSDeviceOGL::RenderHW(GSHWDrawConfig& config) SetupOM(config.alpha_second_pass.depth); SendHWDraw(config, rt_feedbackloop_pass2 ? draw_rt_clone : nullptr, draw_rt, ds_feedbackloop_pass2 ? draw_ds_clone : nullptr, draw_ds_as_rt ? draw_ds_as_rt : draw_ds, one_barrier, config.alpha_second_pass.require_full_barrier); + + if (config.blend_multi_pass.enable) + { + if (config.blend.IsEffective(config.alpha_second_pass.colormask)) + { + OMSetBlendState(config.blend_multi_pass.blend.enable, s_gl_blend_factors[config.blend_multi_pass.blend.src_factor], + s_gl_blend_factors[config.blend_multi_pass.blend.dst_factor], s_gl_blend_ops[config.blend_multi_pass.blend.op], + s_gl_blend_factors[config.blend_multi_pass.blend.src_factor_alpha], s_gl_blend_factors[config.blend_multi_pass.blend.dst_factor_alpha], + config.blend_multi_pass.blend.constant_enable, config.blend_multi_pass.blend.constant); + } + else + { + OMSetBlendState(); + } + psel.ps.no_color1 = config.blend_multi_pass.no_color1; + psel.ps.blend_hw = config.blend_multi_pass.blend_hw; + psel.ps.dither = config.blend_multi_pass.dither; + SetupPipeline(psel); + Draw(config); + } } if (colclip_rt) diff --git a/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp b/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp index f9aab2a812..fabbad37b8 100644 --- a/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp +++ b/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp @@ -6633,7 +6633,7 @@ void GSDeviceVK::RenderHW(GSHWDrawConfig& config) pipe.IsDepthFeedbackLoop() ? depth_for_barrier : nullptr, config.require_one_barrier, config.require_full_barrier); - // blend second pass + // blend multi pass if (config.blend_multi_pass.enable) { if (config.blend_multi_pass.blend.constant_enable) @@ -6644,10 +6644,7 @@ void GSDeviceVK::RenderHW(GSHWDrawConfig& config) pipe.ps.blend_hw = config.blend_multi_pass.blend_hw; pipe.ps.dither = config.blend_multi_pass.dither; if (BindDrawPipeline(pipe)) - { - // TODO: This probably should have barriers, in case we want to use it conditionally. Draw(config); - } } // and the alpha pass @@ -6670,6 +6667,20 @@ void GSDeviceVK::RenderHW(GSHWDrawConfig& config) pipe.IsDepthFeedbackLoop() ? depth_for_barrier : nullptr, config.alpha_second_pass.require_one_barrier, config.alpha_second_pass.require_full_barrier); } + + // blend multi pass with alpha second pass + if (config.blend_multi_pass.enable) + { + if (config.blend_multi_pass.blend.constant_enable) + SetBlendConstants(config.blend_multi_pass.blend.constant); + + pipe.bs = config.blend_multi_pass.blend; + pipe.ps.no_color1 = config.blend_multi_pass.no_color1; + pipe.ps.blend_hw = config.blend_multi_pass.blend_hw; + pipe.ps.dither = config.blend_multi_pass.dither; + if (BindDrawPipeline(pipe)) + Draw(config); + } } if (draw_rt_clone)