librashader_runtime_mtl/
lib.rs1#![cfg(target_vendor = "apple")]
7#![cfg_attr(not(feature = "stable"), feature(type_alias_impl_trait))]
8
9mod buffer;
10mod draw_quad;
11mod filter_chain;
12mod filter_pass;
13mod graphics_pipeline;
14mod luts;
15mod samplers;
16mod texture;
17
18pub use filter_chain::FilterChainMetal;
19use objc2_metal::MTLPixelFormat;
20
21pub mod error;
22pub mod options;
23use librashader_runtime::impl_filter_chain_parameters;
24impl_filter_chain_parameters!(FilterChainMetal);
25
26pub use texture::MetalTextureRef;
27
28fn select_optimal_pixel_format(format: MTLPixelFormat) -> MTLPixelFormat {
29 if format == MTLPixelFormat::RGBA8Unorm {
30 return MTLPixelFormat::BGRA8Unorm;
31 }
32
33 if format == MTLPixelFormat::RGBA8Unorm_sRGB {
34 return MTLPixelFormat::BGRA8Unorm_sRGB;
35 }
36 format
37}