spatialrust_render_wgpu/
lib.rs1#![deny(unsafe_code)]
8#![warn(missing_docs)]
9
10mod error;
11#[cfg(feature = "wgpu")]
12mod geometry;
13#[cfg(feature = "wgpu")]
14mod render;
15#[cfg(feature = "wgpu")]
16mod runtime;
17
18pub use error::{RenderError, RenderResult};
19#[cfg(feature = "wgpu")]
20pub use geometry::{GpuGeometry, GpuGeometryKind};
21#[cfg(feature = "wgpu")]
22pub use render::{
23 GpuRenderTarget, HeadlessRender, PickResult, ReadbackImage, RenderOptions, RenderReceipt,
24 RENDER_TARGET_FORMAT,
25};
26#[cfg(feature = "wgpu")]
27pub use runtime::WgpuRenderer;
28
29#[cfg(all(test, feature = "wgpu"))]
32fn test_runtime() -> Result<std::sync::Arc<spatialrust_gpu::WgpuRuntime>, String> {
33 #[cfg(not(target_arch = "wasm32"))]
34 {
35 spatialrust_gpu::WgpuRuntime::shared().map_err(|error| error.to_string())
36 }
37 #[cfg(target_arch = "wasm32")]
38 {
39 spatialrust_gpu::WgpuRuntime::new_headless()
40 .map(std::sync::Arc::new)
41 .map_err(|error| error.to_string())
42 }
43}