diff options
author | 2020-02-24 20:08:40 +0100 | |
---|---|---|
committer | 2020-02-24 20:08:40 +0100 | |
commit | be14aca07506385a209e89cd99256744a7ec3c0f (patch) | |
tree | bc05c7179ade80db61a2009239c9f5c9615181b5 /wgpu/src/window/swap_chain.rs | |
parent | e680fd27e754aead4003cae72f401090662851b2 (diff) | |
download | iced-be14aca07506385a209e89cd99256744a7ec3c0f.tar.gz iced-be14aca07506385a209e89cd99256744a7ec3c0f.tar.bz2 iced-be14aca07506385a209e89cd99256744a7ec3c0f.zip |
Make output format of `iced_wgpu` configurable
Diffstat (limited to 'wgpu/src/window/swap_chain.rs')
-rw-r--r-- | wgpu/src/window/swap_chain.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/wgpu/src/window/swap_chain.rs b/wgpu/src/window/swap_chain.rs index 6f545fce..4ca2901b 100644 --- a/wgpu/src/window/swap_chain.rs +++ b/wgpu/src/window/swap_chain.rs @@ -18,11 +18,12 @@ impl SwapChain { pub fn new( device: &wgpu::Device, surface: &wgpu::Surface, + format: wgpu::TextureFormat, width: u32, height: u32, ) -> SwapChain { SwapChain { - raw: new_swap_chain(surface, width, height, device), + raw: new_swap_chain(surface, format, width, height, device), viewport: Viewport::new(width, height), } } @@ -38,6 +39,7 @@ impl SwapChain { fn new_swap_chain( surface: &wgpu::Surface, + format: wgpu::TextureFormat, width: u32, height: u32, device: &wgpu::Device, @@ -46,7 +48,7 @@ fn new_swap_chain( &surface, &wgpu::SwapChainDescriptor { usage: wgpu::TextureUsage::OUTPUT_ATTACHMENT, - format: wgpu::TextureFormat::Bgra8UnormSrgb, + format, width, height, present_mode: wgpu::PresentMode::Vsync, |