@@ -136,6 +136,7 @@ fn prepare_bind_group(
136136 game_of_life_images : Res < GameOfLifeImages > ,
137137 game_of_life_uniforms : Res < GameOfLifeUniforms > ,
138138 render_device : Res < RenderDevice > ,
139+ pipeline_cache : Res < PipelineCache > ,
139140 queue : Res < RenderQueue > ,
140141) {
141142 let view_a = gpu_images. get ( & game_of_life_images. texture_a ) . unwrap ( ) ;
@@ -148,7 +149,7 @@ fn prepare_bind_group(
148149
149150 let bind_group_0 = render_device. create_bind_group (
150151 None ,
151- & pipeline. texture_bind_group_layout ,
152+ & pipeline_cache . get_bind_group_layout ( & pipeline. texture_bind_group_layout ) ,
152153 & BindGroupEntries :: sequential ( (
153154 & view_a. texture_view ,
154155 & view_b. texture_view ,
@@ -157,7 +158,7 @@ fn prepare_bind_group(
157158 ) ;
158159 let bind_group_1 = render_device. create_bind_group (
159160 None ,
160- & pipeline. texture_bind_group_layout ,
161+ & pipeline_cache . get_bind_group_layout ( & pipeline. texture_bind_group_layout ) ,
161162 & BindGroupEntries :: sequential ( (
162163 & view_b. texture_view ,
163164 & view_a. texture_view ,
@@ -169,18 +170,17 @@ fn prepare_bind_group(
169170
170171#[ derive( Resource ) ]
171172struct GameOfLifePipeline {
172- texture_bind_group_layout : BindGroupLayout ,
173+ texture_bind_group_layout : BindGroupLayoutDescriptor ,
173174 init_pipeline : CachedComputePipelineId ,
174175 update_pipeline : CachedComputePipelineId ,
175176}
176177
177178fn init_game_of_life_pipeline (
178179 mut commands : Commands ,
179- render_device : Res < RenderDevice > ,
180180 asset_server : Res < AssetServer > ,
181181 pipeline_cache : Res < PipelineCache > ,
182182) {
183- let texture_bind_group_layout = render_device . create_bind_group_layout (
183+ let texture_bind_group_layout = BindGroupLayoutDescriptor :: new (
184184 "GameOfLifeImages" ,
185185 & BindGroupLayoutEntries :: sequential (
186186 ShaderStages :: COMPUTE ,
0 commit comments