From 40f4aac8ab1a6c7830f869a4eefd643322a897d5 Mon Sep 17 00:00:00 2001 From: elbaro Date: Thu, 1 Oct 2026 00:26:59 +0900 Subject: [PATCH] fix(webgpu): add PreMultiplied to alpha_modes (#10507) --- wgpu/src/backend/webgpu.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wgpu/src/backend/webgpu.rs b/wgpu/src/backend/webgpu.rs index 83355fe89..a9ec15b9a 100644 --- a/wgpu/src/backend/webgpu.rs +++ b/wgpu/src/backend/webgpu.rs @@ -4410,7 +4410,11 @@ impl dispatch::SurfaceInterface for WebSurface { formats, // Doesn't really have meaning on the web. present_modes: vec![wgt::PresentMode::Fifo], - alpha_modes: vec![wgt::CompositeAlphaMode::Opaque], + // https://gpuweb.github.io/gpuweb/#gpucanvasalphamode + alpha_modes: vec![ + wgt::CompositeAlphaMode::Opaque, + wgt::CompositeAlphaMode::PreMultiplied, + ], // Statically set to RENDER_ATTACHMENT for now. See https://gpuweb.github.io/gpuweb/#dom-gpucanvasconfiguration-usage usages: wgt::TextureUsages::RENDER_ATTACHMENT, }