| 257 | }; |
| 258 | using DependencySet = skr::FlatHashSet<skr::task::event_t, hash_shared_ptr>; |
| 259 | void update_entry(job_dependency_entry_t& entry, skr::task::event_t job, bool readonly, bool atomic, DependencySet& dependencies) |
| 260 | { |
| 261 | SKR_ASSERT(job); |
| 262 | if (readonly) |
| 263 | { |
| 264 | for (auto& dp : entry.owned) |
| 265 | if(auto ptr = dp.lock()) |
| 266 | dependencies.insert(ptr); |
| 267 | entry.shared.push_back(job); |
| 268 | } |
| 269 | else |
| 270 | { |
| 271 | for (auto& dp : entry.shared) |
| 272 | if(auto ptr = dp.lock()) |
| 273 | dependencies.insert(ptr); |
| 274 | if (atomic) |
| 275 | { |
| 276 | entry.owned.push_back(job); |
| 277 | } |
| 278 | else |
| 279 | { |
| 280 | for (auto& dp : entry.owned) |
| 281 | if(auto ptr = dp.lock()) |
| 282 | dependencies.insert(ptr); |
| 283 | entry.shared.clear(); |
| 284 | entry.owned.clear(); |
| 285 | entry.owned.push_back(job); |
| 286 | } |
| 287 | } |
| 288 | } |
| 289 | } // namespace sugoi |
| 290 | |
| 291 | skr::task::event_t sugoi::scheduler_t::schedule_ecs_job(sugoi_query_t* query, EIndex batchSize, sugoi_system_callback_t callback, void* u, |
no test coverage detected