more clarification
This commit is contained in:
parent
f893fd5ba2
commit
eb53ccc9b1
@ -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 {
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user