diff --git a/pcsx2/GS/Renderers/DX11/GSDevice11.cpp b/pcsx2/GS/Renderers/DX11/GSDevice11.cpp index af5a99108f..66d734f81d 100644 --- a/pcsx2/GS/Renderers/DX11/GSDevice11.cpp +++ b/pcsx2/GS/Renderers/DX11/GSDevice11.cpp @@ -2741,7 +2741,7 @@ void GSDevice11::RenderHW(GSHWDrawConfig& config) OMSetRenderTargets(draw_rt, draw_ds, &config.scissor, read_only_dsv); SetupOM(config.depth, OMBlendSelector(config.colormask, config.blend), config.blend.constant); - SendHWDraw(config, draw_rt_clone, draw_rt, config.require_one_barrier, config.require_full_barrier); + SendHWDraw(config, draw_rt_clone, draw_rt, config.require_one_barrier, config.require_full_barrier, false); if (config.blend_multi_pass.enable) { @@ -2766,7 +2766,7 @@ void GSDevice11::RenderHW(GSHWDrawConfig& config) } SetupOM(config.alpha_second_pass.depth, OMBlendSelector(config.alpha_second_pass.colormask, config.blend), config.blend.constant); - SendHWDraw(config, draw_rt_clone, draw_rt, config.alpha_second_pass.require_one_barrier, config.alpha_second_pass.require_full_barrier); + SendHWDraw(config, draw_rt_clone, draw_rt, config.alpha_second_pass.require_one_barrier, config.alpha_second_pass.require_full_barrier, true); } if (draw_rt_clone) @@ -2793,7 +2793,7 @@ void GSDevice11::RenderHW(GSHWDrawConfig& config) } } -void GSDevice11::SendHWDraw(const GSHWDrawConfig& config, GSTexture* draw_rt_clone, GSTexture* draw_rt, const bool one_barrier, const bool full_barrier) +void GSDevice11::SendHWDraw(const GSHWDrawConfig& config, GSTexture* draw_rt_clone, GSTexture* draw_rt, const bool one_barrier, const bool full_barrier, const bool skip_first_barrier) { if (draw_rt_clone) { @@ -2844,7 +2844,9 @@ void GSDevice11::SendHWDraw(const GSHWDrawConfig& config, GSTexture* draw_rt_clo return; } - CopyAndBind(); + // Optimization: For alpha second pass we can reuse the copy snapshot from the first pass. + if (!skip_first_barrier) + CopyAndBind(); } DrawIndexedPrimitive(); diff --git a/pcsx2/GS/Renderers/DX11/GSDevice11.h b/pcsx2/GS/Renderers/DX11/GSDevice11.h index 6f260cd739..2b3144cf41 100644 --- a/pcsx2/GS/Renderers/DX11/GSDevice11.h +++ b/pcsx2/GS/Renderers/DX11/GSDevice11.h @@ -343,7 +343,7 @@ public: void SetupOM(OMDepthStencilSelector dssel, OMBlendSelector bsel, u8 afix); void RenderHW(GSHWDrawConfig& config) override; - void SendHWDraw(const GSHWDrawConfig& config, GSTexture* draw_rt_clone, GSTexture* draw_rt, const bool one_barrier, const bool full_barrier); + void SendHWDraw(const GSHWDrawConfig& config, GSTexture* draw_rt_clone, GSTexture* draw_rt, const bool one_barrier, const bool full_barrier, const bool skip_first_barrier); void ClearSamplerCache() override;