fix(metal): Explicitly set sRGB surface color space (#10286)

This commit is contained in:
Jinlei Li authored and GitHub committed 2026-09-29 02:10:22 +00:00
1 parent de137ce728
commit 6726fa78ba
2 files changed
+2 -2

No files matched your search

+1
View File
@@ -254,6 +254,7 @@ By @sagudev in [#10109](https://github.com/gfx-rs/wgpu/pull/10109).
- Report `DownlevelFlags::INDIRECT_EXECUTION` and a 256-byte `min_uniform_buffer_offset_alignment` on the iOS Simulator (`target_abi = "sim"`). The Simulator advertises only the Apple2 GPU family but executes indirect draw/dispatch on the host GPU, so compute renderers such as vello previously failed with "Downlevel flags DownlevelFlags(INDIRECT_EXECUTION) are required but not supported". Note that Metal API Validation still rejects indirect commands there. By @edTheGuy00 in [#10189](https://github.com/gfx-rs/wgpu/pull/10189).
- Fix a crash in `Surface::configure` on iOS below 16. `wantsExtendedDynamicRangeContent` is iOS 16+ and is now only called there. By @VladasZ in [#10257](https://github.com/gfx-rs/wgpu/pull/10257).
- Fix a crash when creating a declared alternate sRGB view of a render-attachment-only surface with Metal API Validation enabled. By @jinleili in [#10280](https://github.com/gfx-rs/wgpu/pull/10280).
- Fix oversaturated sRGB surface colors on wide-gamut displays by explicitly setting the layer's sRGB color space. By @jinleili in [#10286](https://github.com/gfx-rs/wgpu/pull/10286).
#### GLES
+1 -2
View File
@@ -297,8 +297,7 @@ impl crate::Surface for super::Surface {
wgt::SurfaceColorSpace::Auto => {
unreachable!("wgpu-core resolves `Auto` before configuring the surface")
}
// Reset to the layer's default, which treats contents as sRGB.
wgt::SurfaceColorSpace::Srgb => None,
wgt::SurfaceColorSpace::Srgb => Some(unsafe { objc2_core_graphics::kCGColorSpaceSRGB }),
wgt::SurfaceColorSpace::ExtendedSrgbLinear => {
Some(unsafe { objc2_core_graphics::kCGColorSpaceExtendedLinearSRGB })
}