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
+10 -4
View File
@@ -1,10 +1,16 @@
//! # Configuration Module
//!
//! Holds shared constants for the WSG library, such as shader paths and other compilation-time values.
//! This module centralizes configuration so that it can be imported by any submodule without duplicating literals.
//! Holds shared constants for the WSG library — primarily shader paths and embedded WGSL source code.
//! Centralized here so all submodules import from one place instead of duplicating literal strings.
//! This enables the PipelineCache to fall back to an embedded default shader when the file-based one is missing.
//!
//! ## Interaction with Other Modules
//! - **pipeline_cache::load_shader()** reads `BASIC_SHADER_PATH` from disk; if unreadable, falls back to `BASIC_SHADER`.
//! - Both constants are compile-time values (`include_str!`) ensuring the fallback shader is always available even without external files.
/// Path to the default WGSL shader file (runtime).
/// Path to the default WGSL shader file on disk (runtime). Used by PipelineCache::load_shader() for file-based loading.
pub const BASIC_SHADER_PATH: &str = "assets/shaders/basic_shader.wgsl";
/// The basic WGSL shader source, embedded at compile time as a fallback.
/// The basic WGSL shader source code, embedded at compile time via `include_str!`.
/// Serves as a fallback when `BASIC_SHADER_PATH` cannot be read at runtime.
pub const BASIC_SHADER: &str = include_str!("../assets/shaders/basic_shader.wgsl");