File tree Expand file tree Collapse file tree
crates/processing_render/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -117,13 +117,22 @@ fn spawn_surface(
117117 let physical_width = ( width as f32 * scale_factor) as u32 ;
118118 let physical_height = ( height as f32 * scale_factor) as u32 ;
119119
120+ // only enable swapchain level transparency on platforms we know support it
121+ // in theory all platforms should support it, but in practice some have weird issues
122+ // TODO: dxgi swapchain for windows https://github.com/gfx-rs/wgpu/issues/3486
123+ let ( transparent, composite_alpha_mode) = match & raw_window_handle {
124+ RawWindowHandle :: AppKit ( _) => ( true , CompositeAlphaMode :: PostMultiplied ) ,
125+ RawWindowHandle :: Wayland ( _) => ( true , CompositeAlphaMode :: PreMultiplied ) ,
126+ _ => ( false , CompositeAlphaMode :: Opaque ) ,
127+ } ;
128+
120129 Ok ( commands
121130 . spawn ( (
122131 Window {
123132 resolution : WindowResolution :: new ( physical_width, physical_height)
124133 . with_scale_factor_override ( scale_factor) ,
125- transparent : true ,
126- composite_alpha_mode : CompositeAlphaMode :: PostMultiplied ,
134+ transparent,
135+ composite_alpha_mode,
127136 ..default ( )
128137 } ,
129138 handle_wrapper,
You can’t perform that action at this time.
0 commit comments