Re-sort view formats
@@ -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,
