mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
7f0b8f3e340a92b707c8f045dc68e8fad77fadeb
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>
Description
No description provided
Languages
Rust
79.9%
WGSL
16.2%
HLSL
2%
GLSL
1.7%
JavaScript
0.2%