GS/HW: Extend blend multipass to work with alpha second pass.

This commit is contained in:
lightningterror committed 2026-11-21 00:14:16 +01:00
1 parent 19d6cb57b2
commit 2d962fef54
4 files changed
+60 -5

No files matched your search

+10
View File
@@ -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)
+15 -1
View File
@@ -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)
+20
View File
@@ -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)
+15 -4
View File
@@ -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)