From 27d34bcb2b07a33605cd514df896aab38fa2e9cc Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Mon, 6 May 2024 22:50:10 -0700 Subject: [PATCH] metal: return AlphaMode::Ignored when not transparent --- Cargo.toml | 2 +- blade-graphics/src/metal/surface.rs | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 63c09066..6d2c6c80 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ bitflags = "2" bytemuck = { version = "1", features = ["derive"] } choir = "0.7" egui = "0.26" -glam = { version = "0.25", features = ["mint"] } +glam = { version = "0.27", features = ["mint"] } gltf = { version = "1.1", default-features = false } log = "0.4" mint = "0.5" diff --git a/blade-graphics/src/metal/surface.rs b/blade-graphics/src/metal/surface.rs index 34583c7a..79e30102 100644 --- a/blade-graphics/src/metal/surface.rs +++ b/blade-graphics/src/metal/surface.rs @@ -97,7 +97,13 @@ impl super::Surface { crate::SurfaceInfo { format, - alpha: crate::AlphaMode::PostMultiplied, + alpha: if config.transparent { + crate::AlphaMode::PostMultiplied + } else { + //Warning: it's not really ignored! Instead, it's assumed to be 1: + // https://developer.apple.com/documentation/quartzcore/calayer/1410763-isopaque + crate::AlphaMode::Ignored + }, } } }