Add 'swap_chain_get_preferred_format' to wgpu-rs (available in wgpu-core but not exposed)
Closed this issue · 1 comments
manugildev commented
we actually have
swap_chain_get_preferred_format
inwgpu-core
. We should expose this inwgpu-rs
Originally posted by @kvark in #511 (comment)
This functionality was commited in gfx-rs/wgpu@6f1d614 but never exposed to wgpu-rs.
Problem: Currently, examples make use of wgpu::TextureFormat::Bgra8UnormSrgb
but that's unreliable and according to the API this method is the way of properly obtaining an optimal texture format for the swapchain based on the platform.
kvark commented
There has been recent discussions upstream about this - gpuweb/gpuweb#1185 and gpuweb/gpuweb#1231
Good news is that this function is still there, and it's not asynchronous! So exposing it in wgpu-rs should be trivial (and much needed).