File tree 10 files changed +15
-15
lines changed
10 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -347,7 +347,7 @@ pub fn extract_lights(
347
347
) ) ;
348
348
}
349
349
* previous_point_lights_len = point_lights_values. len ( ) ;
350
- commands. insert_or_spawn_batch ( point_lights_values) ;
350
+ commands. try_insert_batch ( point_lights_values) ;
351
351
352
352
let mut spot_lights_values = Vec :: with_capacity ( * previous_spot_lights_len) ;
353
353
for entity in global_point_lights. iter ( ) . copied ( ) {
@@ -410,7 +410,7 @@ pub fn extract_lights(
410
410
}
411
411
}
412
412
* previous_spot_lights_len = spot_lights_values. len ( ) ;
413
- commands. insert_or_spawn_batch ( spot_lights_values) ;
413
+ commands. try_insert_batch ( spot_lights_values) ;
414
414
415
415
for (
416
416
main_entity,
Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ fn apply_wireframe_material(
167
167
let material = get_wireframe_material ( maybe_color, & mut materials, & global_material) ;
168
168
material_to_spawn. push ( ( e, MeshMaterial3d ( material) ) ) ;
169
169
}
170
- commands. insert_or_spawn_batch ( material_to_spawn) ;
170
+ commands. try_insert_batch ( material_to_spawn) ;
171
171
}
172
172
173
173
type WireframeFilter = ( With < Mesh3d > , Without < Wireframe > , Without < NoWireframe > ) ;
@@ -195,7 +195,7 @@ fn apply_global_wireframe_material(
195
195
// This makes it easy to detect which mesh is using the global material and which ones are user specified
196
196
material_to_spawn. push ( ( e, MeshMaterial3d ( material) ) ) ;
197
197
}
198
- commands. insert_or_spawn_batch ( material_to_spawn) ;
198
+ commands. try_insert_batch ( material_to_spawn) ;
199
199
} else {
200
200
for e in & meshes_with_global_material {
201
201
commands
Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ fn prepare_uniform_components<C>(
154
154
)
155
155
} )
156
156
. collect :: < Vec < _ > > ( ) ;
157
- commands. insert_or_spawn_batch ( entities) ;
157
+ commands. try_insert_batch ( entities) ;
158
158
}
159
159
160
160
/// This plugin extracts the components into the render world for synced entities.
@@ -212,7 +212,7 @@ fn extract_components<C: ExtractComponent>(
212
212
}
213
213
}
214
214
* previous_len = values. len ( ) ;
215
- commands. insert_or_spawn_batch ( values) ;
215
+ commands. try_insert_batch ( values) ;
216
216
}
217
217
218
218
/// This system extracts all components of the corresponding [`ExtractComponent`], for entities that are visible and synced via [`crate::sync_world::SyncToRenderWorld`].
@@ -232,5 +232,5 @@ fn extract_visible_components<C: ExtractComponent>(
232
232
}
233
233
}
234
234
* previous_len = values. len ( ) ;
235
- commands. insert_or_spawn_batch ( values) ;
235
+ commands. try_insert_batch ( values) ;
236
236
}
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ fn prepare_gpu_component_array_buffers<C: Component + GpuArrayBufferable>(
53
53
. iter ( )
54
54
. map ( |( entity, component) | ( entity, gpu_array_buffer. push ( component. clone ( ) ) ) )
55
55
. collect :: < Vec < _ > > ( ) ;
56
- commands. insert_or_spawn_batch ( entities) ;
56
+ commands. try_insert_batch ( entities) ;
57
57
58
58
gpu_array_buffer. write_buffer ( & render_device, & render_queue) ;
59
59
}
Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ fn apply_wireframe_material(
180
180
} ;
181
181
wireframes_to_spawn. push ( ( e, MeshMaterial2d ( material) ) ) ;
182
182
}
183
- commands. insert_or_spawn_batch ( wireframes_to_spawn) ;
183
+ commands. try_insert_batch ( wireframes_to_spawn) ;
184
184
}
185
185
186
186
type Wireframe2dFilter = ( With < Mesh2d > , Without < Wireframe2d > , Without < NoWireframe2d > ) ;
@@ -209,7 +209,7 @@ fn apply_global_wireframe_material(
209
209
// This makes it easy to detect which mesh is using the global material and which ones are user specified
210
210
material_to_spawn. push ( ( e, MeshMaterial2d ( global_material. handle . clone ( ) ) ) ) ;
211
211
}
212
- commands. insert_or_spawn_batch ( material_to_spawn) ;
212
+ commands. try_insert_batch ( material_to_spawn) ;
213
213
} else {
214
214
for e in & meshes_with_global_material {
215
215
commands
Original file line number Diff line number Diff line change @@ -526,7 +526,7 @@ pub fn prepare_shadows(
526
526
ui_meta. vertices . write_buffer ( & render_device, & render_queue) ;
527
527
ui_meta. indices . write_buffer ( & render_device, & render_queue) ;
528
528
* previous_len = batches. len ( ) ;
529
- commands. insert_or_spawn_batch ( batches) ;
529
+ commands. try_insert_batch ( batches) ;
530
530
}
531
531
extracted_shadows. box_shadows . clear ( ) ;
532
532
}
Original file line number Diff line number Diff line change @@ -1389,7 +1389,7 @@ pub fn prepare_uinodes(
1389
1389
ui_meta. vertices . write_buffer ( & render_device, & render_queue) ;
1390
1390
ui_meta. indices . write_buffer ( & render_device, & render_queue) ;
1391
1391
* previous_len = batches. len ( ) ;
1392
- commands. insert_or_spawn_batch ( batches) ;
1392
+ commands. try_insert_batch ( batches) ;
1393
1393
}
1394
1394
extracted_uinodes. clear ( ) ;
1395
1395
}
Original file line number Diff line number Diff line change @@ -578,7 +578,7 @@ pub fn prepare_uimaterial_nodes<M: UiMaterial>(
578
578
}
579
579
ui_meta. vertices . write_buffer ( & render_device, & render_queue) ;
580
580
* previous_len = batches. len ( ) ;
581
- commands. insert_or_spawn_batch ( batches) ;
581
+ commands. try_insert_batch ( batches) ;
582
582
}
583
583
extracted_uinodes. uinodes . clear ( ) ;
584
584
}
Original file line number Diff line number Diff line change @@ -649,7 +649,7 @@ pub fn prepare_ui_slices(
649
649
ui_meta. vertices . write_buffer ( & render_device, & render_queue) ;
650
650
ui_meta. indices . write_buffer ( & render_device, & render_queue) ;
651
651
* previous_len = batches. len ( ) ;
652
- commands. insert_or_spawn_batch ( batches) ;
652
+ commands. try_insert_batch ( batches) ;
653
653
}
654
654
extracted_slices. slices . clear ( ) ;
655
655
}
Original file line number Diff line number Diff line change @@ -357,7 +357,7 @@ pub fn extract_colored_mesh2d(
357
357
) ;
358
358
}
359
359
* previous_len = values. len ( ) ;
360
- commands. insert_or_spawn_batch ( values) ;
360
+ commands. try_insert_batch ( values) ;
361
361
}
362
362
363
363
/// Queue the 2d meshes marked with [`ColoredMesh2d`] using our custom pipeline and draw function
You can’t perform that action at this time.
0 commit comments