From eb53ccc9b11405badb214530710254ed6eae141e Mon Sep 17 00:00:00 2001 From: Emerson Coskey Date: Sun, 13 Jul 2025 12:13:35 -0700 Subject: [PATCH] more clarification --- examples/shader/custom_phase_item.rs | 4 +--- .../migration-guides/composable_specialization.md | 11 +++++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/examples/shader/custom_phase_item.rs b/examples/shader/custom_phase_item.rs index eb9f91e541..45bca5652b 100644 --- a/examples/shader/custom_phase_item.rs +++ b/examples/shader/custom_phase_item.rs @@ -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, - /// the base_descriptor holds onto the shader handle, this field is - /// unused but here for demonstration purposes. - _shader: Handle, } impl FromWorld for CustomPhasePipeline { diff --git a/release-content/migration-guides/composable_specialization.md b/release-content/migration-guides/composable_specialization.md index 5187cdff24..c33e642b3a 100644 --- a/release-content/migration-guides/composable_specialization.md +++ b/release-content/migration-guides/composable_specialization.md @@ -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, - - // these fields are unused, they're just here for demonstration purposes - layout: BindGroupLayout, - layout_msaa: BindGroupLayout, - vertex: Handle, - fragment: Handle, } pub struct MySpecializer {