doc
This commit is contained in:
@@ -23,9 +23,9 @@ pub struct Material {
|
||||
|
||||
impl Material {
|
||||
/// Creates a new Material by requesting the cache to provide (or create) its RenderPipeline.
|
||||
/// Inputs: device (GPU command source for pipeline creation), format (surface texture format),
|
||||
/// shader_id (unique key into PipelineCache), cache (mutable ref for potential insertion).
|
||||
/// Returns a Material holding the Arc-wrapped pipeline. Called at scene initialization time.
|
||||
/// Inputs: format (surface texture format required for fragment output), shader_id (unique key into PipelineCache),
|
||||
/// cache (mutable reference for potential insertion of new pipelines).
|
||||
/// Returns a Material holding the Arc-wrapped pipeline. Called at scene initialization time only.
|
||||
pub fn new(format: wgpu::TextureFormat, shader_id: &str, cache: &mut PipelineCache) -> Self {
|
||||
// Request pipeline from cache — returns cached instance if already exists, creates new otherwise
|
||||
let pipeline = cache.get_or_create(format, shader_id);
|
||||
|
||||
Reference in New Issue
Block a user