From 44a31fe6033df93f3c4ac0cbffabd80b952e5174 Mon Sep 17 00:00:00 2001 From: Kevin Reid Date: Fri, 26 Jun 2026 22:05:15 -0700 Subject: [PATCH] Make `SurfaceColorSpace` accessors `const fn` --- wgpu-types/src/surface.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wgpu-types/src/surface.rs b/wgpu-types/src/surface.rs index 0087eb1b1..f15c3fedd 100644 --- a/wgpu-types/src/surface.rs +++ b/wgpu-types/src/surface.rs @@ -418,7 +418,7 @@ impl SurfaceColorSpace { /// Returns the [`SurfaceColorSpaces`] flag set holding just this color space, /// or `None` for [`Auto`](Self::Auto) (which maps to no specific flag). #[must_use] - pub fn to_color_spaces(self) -> Option { + pub const fn to_color_spaces(self) -> Option { match self { Self::Auto => None, Self::Srgb => Some(SurfaceColorSpaces::SRGB), @@ -444,7 +444,7 @@ impl SurfaceColorSpace { /// [`SurfaceCapabilities`]: only an HDR result drives highlights above SDR /// white (`1.0`). #[must_use] - pub fn is_hdr(self) -> bool { + pub const fn is_hdr(self) -> bool { match self { Self::ExtendedSrgbLinear | Self::ExtendedSrgb