diff --git a/crates/gpui/src/platform/windows/directx_renderer.rs b/crates/gpui/src/platform/windows/directx_renderer.rs index 837cd7ef1eb7417cd593a646fd62f00b8993b86d..6680bc3887dd90a21446046f35e9ad133a3a37fb 100644 --- a/crates/gpui/src/platform/windows/directx_renderer.rs +++ b/crates/gpui/src/platform/windows/directx_renderer.rs @@ -1377,7 +1377,7 @@ fn create_blend_state(device: &ID3D11Device) -> Result { desc.RenderTarget[0].BlendEnable = true.into(); desc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD; desc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD; - desc.RenderTarget[0].SrcBlend = D3D11_BLEND_SRC_ALPHA; + desc.RenderTarget[0].SrcBlend = D3D11_BLEND_ONE; desc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ONE; desc.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_ALPHA; desc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_ONE; diff --git a/crates/gpui/src/platform/windows/shaders.hlsl b/crates/gpui/src/platform/windows/shaders.hlsl index a934102ce911c7ca7c1e0fa3290fe93d6d646160..58145c82c3d7f61c8085d495fbff9416c21e721d 100644 --- a/crates/gpui/src/platform/windows/shaders.hlsl +++ b/crates/gpui/src/platform/windows/shaders.hlsl @@ -957,7 +957,8 @@ float4 paths_fragment(PathFragmentInput input): SV_Target { float4 color = gradient_color(background, input.position.xy, input.bounds, input.solid_color, input.color0, input.color1); - return color; + // Return premultiplied alpha for correct blending + return float4(color.rgb * color.a, color.a); } // --- path sprite --- //