From 4ea31598a018cbd24b75bc10a2100b1e522fd613 Mon Sep 17 00:00:00 2001 From: Connor Fitzgerald Date: Thu, 2 Feb 2023 03:22:33 -0500 Subject: [PATCH] Re-sort view formats (#3444) --- wgpu-core/src/device/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index 0e2d31e887..c344ece757 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -3329,7 +3329,9 @@ impl Global { ) -> Result { profiling::scope!("Surface::get_capabilities"); self.fetch_adapter_and_surface::(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,