sable-gpu 0.1.0

GPU abstraction layer for Sable Engine - wgpu-based rendering primitives
Documentation
//! # Sable GPU
//!
//! GPU abstraction layer providing cross-platform rendering primitives using wgpu.
//!
//! ## Modules
//!
//! - [`context`] — GPU context and device management
//! - [`buffer`] — GPU buffer types (vertex, index, uniform)
//! - [`pipeline`] — Render pipeline builder
//! - [`shader`] — Shader loading and management
//! - [`vertex`] — Vertex type definitions and layouts
//!
//! ## Quick Start
//!
//! ```rust,ignore
//! use sable_gpu::prelude::*;
//! use sable_platform::prelude::*;
//!
//! async fn setup(window: &Window) -> GpuContext {
//!     GpuContext::new(window).await.unwrap()
//! }
//! ```
//!
//! ## Backend Selection
//!
//! By default, wgpu selects the best available backend:
//! - Windows: DirectX 12 or Vulkan
//! - macOS/iOS: Metal
//! - Linux: Vulkan
//! - Web: WebGPU or WebGL

#![warn(missing_docs)]
#![warn(clippy::all)]
#![warn(clippy::pedantic)]
#![allow(clippy::module_name_repetitions)]

pub mod buffer;
pub mod context;
pub mod pipeline;
pub mod shader;
pub mod vertex;

mod error;

pub use error::{GpuError, Result};

/// Prelude module for convenient imports.
pub mod prelude {
    pub use crate::buffer::{Buffer, BufferUsage, IndexBuffer, VertexBuffer};
    pub use crate::context::GpuContext;
    pub use crate::pipeline::{PipelineBuilder, RenderPipeline};
    pub use crate::shader::Shader;
    pub use crate::vertex::{PositionColorVertex, Vertex};
    pub use crate::{GpuError, Result};
}