Change metal format to BGRA8Unorm

This should fix channel swizzling on M1 and restore functionality on Intel
This commit is contained in:
Chad Brokaw 2022-05-10 04:09:02 -04:00
parent 3ff87c88a7
commit c95887b4df

View file

@ -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);