Re-sort view formats (#3444)

This commit is contained in:
Connor Fitzgerald 2023-02-02 03:22:33 -05:00
parent 37d24fba00
commit 7b336805f1

View File

@ -3329,7 +3329,9 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
) -> Result<wgt::SurfaceCapabilities, instance::GetSurfaceSupportError> {
profiling::scope!("Surface::get_capabilities");
self.fetch_adapter_and_surface::<A, _, _>(surface_id, adapter_id, |adapter, surface| {
let hal_caps = surface.get_capabilities(adapter)?;
let mut hal_caps = surface.get_capabilities(adapter)?;
hal_caps.formats.sort_by_key(|f| !f.describe().srgb);
Ok(wgt::SurfaceCapabilities {
formats: hal_caps.formats,