Advertise PreMultipled rather than PostMultiplied alpha for metal backend (#9922)

Signed-off-by: Nico Burns <nico@nicoburns.com>
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
This commit is contained in:
Nico BurnsandErich Gubler authored and GitHub committed 2026-08-18 10:48:42 -04:00
1 parent 8ee190c6f1
commit f32f76dcb1
3 files changed
+4 -2

No files matched your search

+2
View File
@@ -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
+1 -1
View File
@@ -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()),
+1 -1
View File
@@ -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),
_ => (),
}