wgpu: Use premultiplied alpha for bitmaps

This commit is contained in:
Mike Welsh 2020-10-15 15:28:17 -07:00
parent 4558be948e
commit 89c1378569
1 changed files with 2 additions and 2 deletions

View File

@ -369,7 +369,7 @@ fn create_bitmap_pipeline(
&[wgpu::ColorStateDescriptor { &[wgpu::ColorStateDescriptor {
format: wgpu::TextureFormat::Bgra8Unorm, format: wgpu::TextureFormat::Bgra8Unorm,
color_blend: wgpu::BlendDescriptor { color_blend: wgpu::BlendDescriptor {
src_factor: wgpu::BlendFactor::SrcAlpha, src_factor: wgpu::BlendFactor::One,
dst_factor: wgpu::BlendFactor::OneMinusSrcAlpha, dst_factor: wgpu::BlendFactor::OneMinusSrcAlpha,
operation: wgpu::BlendOperation::Add, operation: wgpu::BlendOperation::Add,
}, },
@ -433,7 +433,7 @@ fn create_bitmap_pipeline(
&[wgpu::ColorStateDescriptor { &[wgpu::ColorStateDescriptor {
format: wgpu::TextureFormat::Bgra8Unorm, format: wgpu::TextureFormat::Bgra8Unorm,
color_blend: wgpu::BlendDescriptor { color_blend: wgpu::BlendDescriptor {
src_factor: wgpu::BlendFactor::SrcAlpha, src_factor: wgpu::BlendFactor::One,
dst_factor: wgpu::BlendFactor::OneMinusSrcAlpha, dst_factor: wgpu::BlendFactor::OneMinusSrcAlpha,
operation: wgpu::BlendOperation::Add, operation: wgpu::BlendOperation::Add,
}, },