From c95887b4df7a898e1eec9392984fd470f349ca73 Mon Sep 17 00:00:00 2001 From: Chad Brokaw Date: Tue, 10 May 2022 04:09:02 -0400 Subject: [PATCH] Change metal format to BGRA8Unorm This should fix channel swizzling on M1 and restore functionality on Intel --- piet-gpu-hal/src/metal.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/piet-gpu-hal/src/metal.rs b/piet-gpu-hal/src/metal.rs index 307def8..03a23b0 100644 --- a/piet-gpu-hal/src/metal.rs +++ b/piet-gpu-hal/src/metal.rs @@ -350,7 +350,7 @@ impl crate::backend::Device for MtlDevice { //desc.set_mipmap_level_count(1); let mtl_format = match format { ImageFormat::A8 => metal::MTLPixelFormat::R8Unorm, - ImageFormat::Rgba8 => metal::MTLPixelFormat::RGBA8Unorm, + ImageFormat::Rgba8 => metal::MTLPixelFormat::BGRA8Unorm, }; desc.set_pixel_format(mtl_format); desc.set_usage(metal::MTLTextureUsage::ShaderRead | metal::MTLTextureUsage::ShaderWrite);