From 89c5564133145230d0d93165c10f99cc8b2a6f94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Ginth=C3=B6r?= Date: Fri, 12 Apr 2019 17:44:44 +0200 Subject: [PATCH] Configure Swapchain with supported composite_alpha --- wgpu-native/src/device.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wgpu-native/src/device.rs b/wgpu-native/src/device.rs index e0e19dfb7..7528ff813 100644 --- a/wgpu-native/src/device.rs +++ b/wgpu-native/src/device.rs @@ -1534,7 +1534,7 @@ pub fn device_create_swap_chain( let mut surface_guard = HUB.surfaces.write(); let surface = &mut surface_guard[surface_id]; - let (caps, formats, _present_modes, _composite_alphas) = { + let (caps, formats, _present_modes, composite_alphas) = { let adapter_guard = HUB.adapters.read(); let adapter = &adapter_guard[device.adapter_id]; assert!(surface @@ -1544,12 +1544,13 @@ pub fn device_create_swap_chain( }; let num_frames = caps.image_count.start; //TODO: configure? let usage = conv::map_texture_usage(desc.usage, hal::format::Aspects::COLOR); - let config = hal::SwapchainConfig::new( + let mut config = hal::SwapchainConfig::new( desc.width, desc.height, conv::map_texture_format(desc.format), num_frames, //TODO: configure? ); + config.composite_alpha = *composite_alphas.iter().next().unwrap(); if let Some(formats) = formats { assert!(