diff --git a/CHANGELOG.md b/CHANGELOG.md index 29e37b3f3..404a44895 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -124,6 +124,8 @@ Bottom level categories: #### Metal - Fix bind group resources for the task, mesh, fragment, and compute shader stages being bound from the wrong offsets whenever a bind group contained resources visible to the task or mesh stages, which could bind the wrong buffer, texture, or sampler to a shader slot. By @teoxoy in [#10043](https://github.com/gfx-rs/wgpu/issues/10043). +- BREAKING: Advertise `CompositeAlphaMode::PreMultiplied` instead of `PostMultiplied`, matching the premultiplied alpha compositing that Core Animation actually performs for a non-opaque `CAMetalLayer`. By @nicoburns in [#9922](https://github.com/gfx-rs/wgpu/pull/9922). + - If you previously hard-coded `PostMultiplied` to get a transparent macOS window, you will start receiving `UnsupportedAlphaMode` validation errors for this. Those affected should migrate to `PreMultiplied` instead. #### GLES diff --git a/wgpu-hal/src/metal/adapter.rs b/wgpu-hal/src/metal/adapter.rs index 881907b3a..f5661b916 100644 --- a/wgpu-hal/src/metal/adapter.rs +++ b/wgpu-hal/src/metal/adapter.rs @@ -471,7 +471,7 @@ impl crate::Adapter for super::Adapter { }, composite_alpha_modes: vec![ wgt::CompositeAlphaMode::Opaque, - wgt::CompositeAlphaMode::PostMultiplied, + wgt::CompositeAlphaMode::PreMultiplied, ], current_extent: Some(surface.dimensions()), diff --git a/wgpu-hal/src/metal/surface.rs b/wgpu-hal/src/metal/surface.rs index b2bc11a26..5ccfe6eb2 100644 --- a/wgpu-hal/src/metal/surface.rs +++ b/wgpu-hal/src/metal/surface.rs @@ -268,7 +268,7 @@ impl crate::Surface for super::Surface { match config.composite_alpha_mode { wgt::CompositeAlphaMode::Opaque => render_layer.setOpaque(true), - wgt::CompositeAlphaMode::PostMultiplied => render_layer.setOpaque(false), + wgt::CompositeAlphaMode::PreMultiplied => render_layer.setOpaque(false), _ => (), }