more clarification

This commit is contained in:
Emerson Coskey 2025-07-13 12:13:35 -07:00
parent f893fd5ba2
commit eb53ccc9b1
No known key found for this signature in database
2 changed files with 6 additions and 9 deletions

View File

@ -280,10 +280,8 @@ struct CustomPhaseSpecializer;
#[derive(Resource)]
struct CustomPhasePipeline {
/// the specialized_cache holds onto the shader handle through the base descriptor
specialized_cache: SpecializedCache<RenderPipeline, CustomPhaseSpecializer>,
/// the base_descriptor holds onto the shader handle, this field is
/// unused but here for demonstration purposes.
_shader: Handle<Shader>,
}
impl FromWorld for CustomPhasePipeline {

View File

@ -145,13 +145,12 @@ After:
```rust
#[derive(Resource)]
pub struct MyPipeline {
// the base_descriptor and specializer each hold onto the static
// wgpu resources (layout, shader handles), so we don't need
// explicit fields for them here. However, real-world cases
// may still need to duplicate them as fields to create bind
// groups from, etc.
specialized_cache: SpecializedCache<RenderPipeline, MySpecializer>,
// these fields are unused, they're just here for demonstration purposes
layout: BindGroupLayout,
layout_msaa: BindGroupLayout,
vertex: Handle<Shader>,
fragment: Handle<Shader>,
}
pub struct MySpecializer {