sable_gpu/lib.rs
1//! # Sable GPU
2//!
3//! GPU abstraction layer providing cross-platform rendering primitives using wgpu.
4//!
5//! ## Modules
6//!
7//! - [`context`] — GPU context and device management
8//! - [`buffer`] — GPU buffer types (vertex, index, uniform)
9//! - [`pipeline`] — Render pipeline builder
10//! - [`shader`] — Shader loading and management
11//! - [`vertex`] — Vertex type definitions and layouts
12//!
13//! ## Quick Start
14//!
15//! ```rust,ignore
16//! use sable_gpu::prelude::*;
17//! use sable_platform::prelude::*;
18//!
19//! async fn setup(window: &Window) -> GpuContext {
20//! GpuContext::new(window).await.unwrap()
21//! }
22//! ```
23//!
24//! ## Backend Selection
25//!
26//! By default, wgpu selects the best available backend:
27//! - Windows: DirectX 12 or Vulkan
28//! - macOS/iOS: Metal
29//! - Linux: Vulkan
30//! - Web: WebGPU or WebGL
31
32#![warn(missing_docs)]
33#![warn(clippy::all)]
34#![warn(clippy::pedantic)]
35#![allow(clippy::module_name_repetitions)]
36
37pub mod buffer;
38pub mod context;
39pub mod pipeline;
40pub mod shader;
41pub mod vertex;
42
43mod error;
44
45pub use error::{GpuError, Result};
46
47/// Prelude module for convenient imports.
48pub mod prelude {
49 pub use crate::buffer::{Buffer, BufferUsage, IndexBuffer, VertexBuffer};
50 pub use crate::context::GpuContext;
51 pub use crate::pipeline::{PipelineBuilder, RenderPipeline};
52 pub use crate::shader::Shader;
53 pub use crate::vertex::{PositionColorVertex, Vertex};
54 pub use crate::{GpuError, Result};
55}