ajout material et pipeline_cache

This commit is contained in:
Jérôme Bousquié
2026-07-06 10:40:00 +02:00
parent 22edac6ad5
commit 6c94fc96d6
12 changed files with 464 additions and 316 deletions
+20 -1
View File
@@ -1,8 +1,27 @@
//! # WSG Library — Public API Surface
//!
//! Re-exports all submodules so consumers can access types via `wsg::mesh::Mesh`, etc.
//! The library's core responsibility is to abstract five wgpu objects (Instance, Surface, Adapter, Device, Queue)
//! into a single Context for simpler user interaction.
//!
//! ## Module Interactions
//! - **context** owns hardware resources (Device, Queue, Surface) across the frame lifecycle.
//! - **pipeline_cache** compiles WGSL shaders into RenderPipelines once, caching them via HashMap + Arc.
//! - **material** requests pipelines from PipelineCache to define per-object appearance.
//! - **mesh** holds vertex/index buffers sent to the GPU once at creation time.
//! - **renderer** orchestrates draw calls using Material + Mesh references passed in at render time.
//! - **vertex** defines the CPU-side vertex layout matching GPU shader input attributes.
//! - **error** provides application-level error types mapping each failure mode to a message.
//! - **conf** centralizes shared constants like shader paths and embedded fallback sources.
pub mod conf;
pub mod context;
pub mod error;
pub mod material;
pub mod mesh;
pub mod pipeline_cache;
pub mod renderer;
pub mod vertex;
pub use error::WsgError; // Pour permettre un import direct du type
/// Re-export of the application-level error type for direct use by consumers.
pub use error::WsgError; // For convenient import without path prefix