Merge remote-tracking branch 'origin/master' into 1.10
This commit is contained in:
@@ -127,6 +127,7 @@ namespace ParticleManagerImpl
|
||||
using namespace ParticleManagerImpl;
|
||||
|
||||
TaskGraphSystem* Particles::System = nullptr;
|
||||
ConcurrentSystemLocker Particles::SystemLocker;
|
||||
bool Particles::EnableParticleBufferPooling = true;
|
||||
float Particles::ParticleBufferRecycleTimeout = 10.0f;
|
||||
|
||||
@@ -155,6 +156,8 @@ class ParticlesSystem : public TaskGraphSystem
|
||||
{
|
||||
public:
|
||||
float DeltaTime, UnscaledDeltaTime, Time, UnscaledTime;
|
||||
bool Active;
|
||||
|
||||
void Job(int32 index);
|
||||
void Execute(TaskGraph* graph) override;
|
||||
void PostExecute(TaskGraph* graph) override;
|
||||
@@ -1406,6 +1409,10 @@ void ParticlesSystem::Execute(TaskGraph* graph)
|
||||
{
|
||||
if (UpdateList.Count() == 0)
|
||||
return;
|
||||
Active = true;
|
||||
|
||||
// Ensure no particle assets can be reloaded/modified during async update
|
||||
Particles::SystemLocker.Begin(false);
|
||||
|
||||
// Setup data for async update
|
||||
const auto& tickData = Time::Update;
|
||||
@@ -1422,8 +1429,13 @@ void ParticlesSystem::Execute(TaskGraph* graph)
|
||||
|
||||
void ParticlesSystem::PostExecute(TaskGraph* graph)
|
||||
{
|
||||
if (!Active)
|
||||
return;
|
||||
PROFILE_CPU_NAMED("Particles.PostExecute");
|
||||
|
||||
// Cleanup
|
||||
Particles::SystemLocker.End(false);
|
||||
Active = false;
|
||||
UpdateList.Clear();
|
||||
|
||||
#if COMPILE_WITH_GPU_PARTICLES
|
||||
|
||||
Reference in New Issue
Block a user