@@ -355,19 +355,24 @@ _addItemsToIndexer(MeshMaterialVariableIndexer* var_indexer,
355
355
IMeshMaterialMng* mm = m_material_mng;
356
356
bool init_with_zero = mm->isDataInitialisationWithZero ();
357
357
358
- // TODO: Comme tout est indépendant par variable, on pourrait
359
- // éventuellement utiliser plusieurs files.
360
358
Accelerator::ProfileRegion ps (m_queue, " InitializeNewItems" , 0xFFFF00 );
361
- RunQueue::ScopedAsync sc (&m_queue);
362
359
363
- auto func = [&](IMeshMaterialVariable* mv) {
364
- if (init_with_zero)
360
+ if (init_with_zero) {
361
+ RunQueue::ScopedAsync sc (&m_queue);
362
+ auto func_zero = [&](IMeshMaterialVariable* mv) {
365
363
mv->_internalApi ()->initializeNewItemsWithZero (list_builder, m_queue);
366
- else
367
- mv->_internalApi ()->initializeNewItemsWithPureValues (list_builder, m_queue);
368
- };
369
- functor::apply (mm, &IMeshMaterialMng::visitVariables, func);
370
- m_queue.barrier ();
364
+ };
365
+ functor::apply (mm, &IMeshMaterialMng::visitVariables, func_zero);
366
+ m_queue.barrier ();
367
+ }
368
+ else {
369
+ SmallSpan<Int32> partial_indexes = list_builder.partialIndexes ();
370
+ SmallSpan<Int32> partial_local_ids = list_builder.partialLocalIds ();
371
+
372
+ CopyBetweenPartialAndGlobalArgs args (var_indexer->index (), partial_local_ids,
373
+ partial_indexes, true , true , m_queue);
374
+ _copyBetweenPartialsAndGlobals (args);
375
+ }
371
376
}
372
377
}
373
378
0 commit comments