| 1747 | } |
| 1748 | |
| 1749 | void ParticlesSystem::Execute(TaskGraph* graph) |
| 1750 | { |
| 1751 | if (UpdateList.Count() == 0) |
| 1752 | return; |
| 1753 | Active = true; |
| 1754 | |
| 1755 | // Ensure no particle assets can be reloaded/modified during async update |
| 1756 | Particles::SystemLocker.ReadLock(); |
| 1757 | |
| 1758 | // Setup data for async update |
| 1759 | const auto& tickData = Time::Update; |
| 1760 | DeltaTime = tickData.DeltaTime.GetTotalSeconds(); |
| 1761 | UnscaledDeltaTime = tickData.UnscaledDeltaTime.GetTotalSeconds(); |
| 1762 | Time = tickData.Time.GetTotalSeconds(); |
| 1763 | UnscaledTime = tickData.UnscaledTime.GetTotalSeconds(); |
| 1764 | |
| 1765 | // Schedule work to update all particles in async |
| 1766 | Function<void(int32)> job; |
| 1767 | job.Bind<ParticlesSystem, &ParticlesSystem::Job>(this); |
| 1768 | graph->DispatchJob(job, UpdateList.Count()); |
| 1769 | } |
| 1770 | |
| 1771 | void ParticlesSystem::PostExecute(TaskGraph* graph) |
| 1772 | { |
nothing calls this directly
no test coverage detected