frust_render/native_import/mod.rs
1//! Platform importers for the external-texture frame bus: the per-platform
2//! [`NativeImporter`](crate::texture_bus::NativeImporter) implementations that
3//! wrap a `frust-gpu` zero-copy import (a CVPixelBuffer on Apple, an
4//! AHardwareBuffer on Android) so a plugin's native frame draws as a scene
5//! texture without a copy. Each platform half lives behind its own `cfg`; on
6//! every other target the module is empty and [`install`] is a no-op.
7
8#[cfg(target_vendor = "apple")]
9pub mod apple;
10
11#[cfg(target_os = "android")]
12pub mod android;
13
14/// Install the importers this platform supports for the given render context,
15/// once per process. Safe to call every frame; later calls do nothing.
16pub fn install(context: &frust_gpu::RenderContext) {
17 #[cfg(target_os = "android")]
18 android::install(context);
19 #[cfg(target_vendor = "apple")]
20 apple::install(context);
21 #[cfg(not(any(target_os = "android", target_vendor = "apple")))]
22 let _ = context;
23}