@@ -136,6 +136,7 @@ fn prepare_bind_group(
136
136
game_of_life_images : Res < GameOfLifeImages > ,
137
137
game_of_life_uniforms : Res < GameOfLifeUniforms > ,
138
138
render_device : Res < RenderDevice > ,
139
+ pipeline_cache : Res < PipelineCache > ,
139
140
queue : Res < RenderQueue > ,
140
141
) {
141
142
let view_a = gpu_images. get ( & game_of_life_images. texture_a ) . unwrap ( ) ;
@@ -148,7 +149,7 @@ fn prepare_bind_group(
148
149
149
150
let bind_group_0 = render_device. create_bind_group (
150
151
None ,
151
- & pipeline. texture_bind_group_layout ,
152
+ & pipeline_cache . get_bind_group_layout ( & pipeline. texture_bind_group_layout ) ,
152
153
& BindGroupEntries :: sequential ( (
153
154
& view_a. texture_view ,
154
155
& view_b. texture_view ,
@@ -157,7 +158,7 @@ fn prepare_bind_group(
157
158
) ;
158
159
let bind_group_1 = render_device. create_bind_group (
159
160
None ,
160
- & pipeline. texture_bind_group_layout ,
161
+ & pipeline_cache . get_bind_group_layout ( & pipeline. texture_bind_group_layout ) ,
161
162
& BindGroupEntries :: sequential ( (
162
163
& view_b. texture_view ,
163
164
& view_a. texture_view ,
@@ -169,18 +170,17 @@ fn prepare_bind_group(
169
170
170
171
#[ derive( Resource ) ]
171
172
struct GameOfLifePipeline {
172
- texture_bind_group_layout : BindGroupLayout ,
173
+ texture_bind_group_layout : BindGroupLayoutDescriptor ,
173
174
init_pipeline : CachedComputePipelineId ,
174
175
update_pipeline : CachedComputePipelineId ,
175
176
}
176
177
177
178
fn init_game_of_life_pipeline (
178
179
mut commands : Commands ,
179
- render_device : Res < RenderDevice > ,
180
180
asset_server : Res < AssetServer > ,
181
181
pipeline_cache : Res < PipelineCache > ,
182
182
) {
183
- let texture_bind_group_layout = render_device . create_bind_group_layout (
183
+ let texture_bind_group_layout = BindGroupLayoutDescriptor :: new (
184
184
"GameOfLifeImages" ,
185
185
& BindGroupLayoutEntries :: sequential (
186
186
ShaderStages :: COMPUTE ,
0 commit comments