@@ -199,6 +199,25 @@ auto ecsact::rt_entt_codegen::parallel::can_entities_parallel(
199
199
return true ;
200
200
}
201
201
202
+ /* *
203
+ * Quick check to see if a system should run independently regardless of it's
204
+ * system capbilities.
205
+ */
206
+ static auto should_run_independently (ecsact_system_like_id id) -> bool {
207
+ // User has explicitly marked a system as not parallel; respect that.
208
+ if (ecsact_meta_get_system_parallel_execution (id) == ECSACT_PARA_EXEC_DENY) {
209
+ return true ;
210
+ }
211
+
212
+ // Generator systems increase storage so they may not run in parallel with
213
+ // other systems.
214
+ if (!ecsact::meta::get_system_generates_ids (id).empty ()) {
215
+ return true ;
216
+ }
217
+
218
+ return false ;
219
+ }
220
+
202
221
static auto loop_iterator (
203
222
const std::vector<system_like_id_variant>& system_list,
204
223
const std::vector<system_like_id_variant>::iterator begin,
@@ -211,10 +230,8 @@ static auto loop_iterator(
211
230
212
231
for (auto iterator = begin; iterator != system_list.end (); iterator++) {
213
232
auto sys_like_id = *iterator;
214
- auto capabilities = ecsact::meta::system_capabilities (sys_like_id);
215
- auto generate_ids = ecsact::meta::get_system_generates_ids (sys_like_id);
216
233
217
- if (!generate_ids. empty ( )) {
234
+ if (should_run_independently (sys_like_id )) {
218
235
if (!parallel_system_list.empty ()) {
219
236
parallel_system_cluster.push_back (parallel_system_list);
220
237
}
@@ -230,8 +247,8 @@ static auto loop_iterator(
230
247
return ;
231
248
}
232
249
233
- std::set<ecsact_component_like_id> child_unsafe_comps{} ;
234
-
250
+ auto capabilities = ecsact::meta::system_capabilities (sys_like_id) ;
251
+ auto child_unsafe_comps = std::set<ecsact_component_like_id>{};
235
252
auto child_systems = ecsact::meta::get_child_system_ids (sys_like_id);
236
253
237
254
for (auto child_sys_id : child_systems) {
0 commit comments