2024-02-12 10:01:00 +11:00
|
|
|
#![cfg(target_vendor = "apple")]
|
2024-02-12 12:38:55 +11:00
|
|
|
#![feature(type_alias_impl_trait)]
|
|
|
|
|
2024-02-12 09:54:13 +11:00
|
|
|
mod buffer;
|
2024-02-11 12:59:01 +11:00
|
|
|
mod draw_quad;
|
2024-02-12 09:54:13 +11:00
|
|
|
mod filter_chain;
|
|
|
|
mod filter_pass;
|
2024-02-11 12:59:01 +11:00
|
|
|
mod graphics_pipeline;
|
2024-02-12 09:54:13 +11:00
|
|
|
mod luts;
|
2024-02-10 16:04:16 +11:00
|
|
|
mod samplers;
|
2024-02-12 09:54:13 +11:00
|
|
|
mod texture;
|
2024-02-12 12:38:55 +11:00
|
|
|
|
|
|
|
pub use filter_chain::FilterChainMetal;
|
2024-02-13 11:43:28 +11:00
|
|
|
use icrate::Metal::{
|
|
|
|
MTLPixelFormat, MTLPixelFormatBGRA8Unorm, MTLPixelFormatBGRA8Unorm_sRGB,
|
|
|
|
MTLPixelFormatRGBA8Unorm, MTLPixelFormatRGBA8Unorm_sRGB,
|
|
|
|
};
|
2024-02-12 12:38:55 +11:00
|
|
|
|
|
|
|
pub mod error;
|
|
|
|
pub mod options;
|
|
|
|
use librashader_runtime::impl_filter_chain_parameters;
|
|
|
|
impl_filter_chain_parameters!(FilterChainMetal);
|
2024-02-13 11:43:28 +11:00
|
|
|
|
2024-02-13 15:41:18 +11:00
|
|
|
pub use texture::MetalOutputView;
|
|
|
|
|
2024-02-13 11:43:28 +11:00
|
|
|
fn select_optimal_pixel_format(format: MTLPixelFormat) -> MTLPixelFormat {
|
|
|
|
if format == MTLPixelFormatRGBA8Unorm {
|
|
|
|
return MTLPixelFormatBGRA8Unorm;
|
|
|
|
}
|
|
|
|
|
|
|
|
if format == MTLPixelFormatRGBA8Unorm_sRGB {
|
|
|
|
return MTLPixelFormatBGRA8Unorm_sRGB;
|
|
|
|
}
|
|
|
|
return format;
|
|
|
|
}
|