Expose get_swap_chain_preferred_format on Device

- Update examples to make use of the new method
This commit is contained in:
Manuel Gil committed 2021-01-03 17:35:04 +00:00
1 parent 3d605463bb
commit e00ef5d584
6 files changed
+35 -23

No files matched your search

+1 -6
View File
@@ -224,12 +224,7 @@ fn start<E: Example>(
let mut sc_desc = wgpu::SwapChainDescriptor {
usage: wgpu::TextureUsage::RENDER_ATTACHMENT,
// TODO: Allow srgb unconditionally
format: if cfg!(target_arch = "wasm32") {
wgpu::TextureFormat::Bgra8Unorm
} else {
wgpu::TextureFormat::Bgra8UnormSrgb
},
format: device.get_swap_chain_preferred_format(),
width: size.width,
height: size.height,
present_mode: wgpu::PresentMode::Mailbox,