@@ -178,6 +178,25 @@ auto ecsact::rt_entt_codegen::parallel::can_entities_parallel(
178
178
return true ;
179
179
}
180
180
181
+ /* *
182
+ * Quick check to see if a system should run independently regardless of it's
183
+ * system capbilities.
184
+ */
185
+ static auto should_run_independently (ecsact_system_like_id id) -> bool {
186
+ // User has explicitly marked a system as not parallel; respect that.
187
+ if (ecsact_meta_get_system_parallel_execution (id) == ECSACT_PARA_EXEC_DENY) {
188
+ return true ;
189
+ }
190
+
191
+ // Generator systems increase storage so they may not run in parallel with
192
+ // other systems.
193
+ if (!ecsact::meta::get_system_generates_ids (id).empty ()) {
194
+ return true ;
195
+ }
196
+
197
+ return false ;
198
+ }
199
+
181
200
static auto loop_iterator (
182
201
const std::vector<system_like_id_variant>& system_list,
183
202
const std::vector<system_like_id_variant>::iterator begin,
@@ -190,10 +209,8 @@ static auto loop_iterator(
190
209
191
210
for (auto iterator = begin; iterator != system_list.end (); iterator++) {
192
211
auto sys_like_id = *iterator;
193
- auto capabilities = ecsact::meta::system_capabilities (sys_like_id);
194
- auto generate_ids = ecsact::meta::get_system_generates_ids (sys_like_id);
195
212
196
- if (!generate_ids. empty ( )) {
213
+ if (should_run_independently (sys_like_id )) {
197
214
if (!parallel_system_list.empty ()) {
198
215
parallel_system_cluster.push_back (parallel_system_list);
199
216
}
@@ -209,8 +226,8 @@ static auto loop_iterator(
209
226
return ;
210
227
}
211
228
212
- std::set<ecsact_component_like_id> child_unsafe_comps{} ;
213
-
229
+ auto capabilities = ecsact::meta::system_capabilities (sys_like_id) ;
230
+ auto child_unsafe_comps = std::set<ecsact_component_like_id>{};
214
231
auto child_systems = ecsact::meta::get_child_system_ids (sys_like_id);
215
232
216
233
for (auto child_sys_id : child_systems) {
0 commit comments