mirror of
https://github.com/storytold/wgpu.git
synced 2026-12-01 10:34:57 +01:00
Expose get_swap_chain_preferred_format on Device
- Update examples to make use of the new method
This commit is contained in:
1 parent
3d605463bb
commit
e00ef5d584
6 files changed
+35
-23
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user