From 7171849c3e0322913a616469f2cdae618375aa90 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Sat, 28 Oct 2023 01:23:36 +0900 Subject: [PATCH] d3d11screencapturesrc: Fix mouse cursor blending Ignore alpha component of source (mouse cursor texture) when blending alpha channel, otherwise the background area of source (which has zeros) will be written to render target. Then it will result in black rectangle if output texture is converted to premultiplied alpha texture Part-of: --- .../gst-plugins-bad/sys/d3d11/gstd3d11screencapturesrc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11screencapturesrc.cpp b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11screencapturesrc.cpp index d1f13d65ee..13ba11be24 100644 --- a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11screencapturesrc.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11screencapturesrc.cpp @@ -890,8 +890,8 @@ gst_d3d11_screen_capture_prepare_shader (GstD3D11ScreenCaptureSrc * self) blend_desc.RenderTarget[0].SrcBlend = D3D11_BLEND_SRC_ALPHA; blend_desc.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_ALPHA; blend_desc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD; - blend_desc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ONE; - blend_desc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_ZERO; + blend_desc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ZERO; + blend_desc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_ONE; blend_desc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD; blend_desc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;