bors[bot] 7f0b8f3e34 [rs] Merge #693
693: Expose get_swap_chain_preferred_format r=kvark a=manugildev

Fixes #691

This functionality was committed in gfx-rs/wgpu@6f1d614 but never exposed to `wgpu-rs`.

Problem: Examples made use of `wgpu::TextureFormat::Bgra8UnormSrgb` but that's unreliable and according to the [API](https://gpuweb.github.io/gpuweb/#dom-gpucanvascontext-getswapchainpreferredformat) this method is the way of properly obtaining an optimal texture format for the `SwapChain` based on the platform.

- [x]  Expose `get_swap_chain_preferred_format()` on Device
- [x]  Use `TextureFormat::Bgra8Unorm` for [web.rs](e00ef5d584/src/backend/web.rs (L970))
- [x]  Update [framework.rs](e00ef5d584/examples/framework.rs (L227)) and examples to call this new method

Co-authored-by: Manuel Gil <manugildev@gmail.com>
2021-01-04 14:12:35 +00:00
2020-04-26 18:59:48 -02:30
Description
No description provided
137 MiB
Languages
Rust 79.9%
WGSL 16.2%
HLSL 2%
GLSL 1.7%
JavaScript 0.2%