Don't blend alpha channels
Antonio Scandurra
and
Nathan Sobo
created 4 years ago
We want to use the source alpha to determine the color of the final
pixel, but we want the final pixels to be fully opaque.
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Change summary
gpui/src/platform/mac/renderer.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Detailed changes
@@ -709,9 +709,9 @@ fn build_pipeline_state(
color_attachment.set_rgb_blend_operation(metal::MTLBlendOperation::Add);
color_attachment.set_alpha_blend_operation(metal::MTLBlendOperation::Add);
color_attachment.set_source_rgb_blend_factor(metal::MTLBlendFactor::SourceAlpha);
- color_attachment.set_source_alpha_blend_factor(metal::MTLBlendFactor::SourceAlpha);
+ color_attachment.set_source_alpha_blend_factor(metal::MTLBlendFactor::One);
color_attachment.set_destination_rgb_blend_factor(metal::MTLBlendFactor::OneMinusSourceAlpha);
- color_attachment.set_destination_alpha_blend_factor(metal::MTLBlendFactor::OneMinusSourceAlpha);
+ color_attachment.set_destination_alpha_blend_factor(metal::MTLBlendFactor::One);
device
.new_render_pipeline_state(&descriptor)