Add more profiler events and naming for particles/animations jobs events

This commit is contained in:
Wojtek Figat
2021-08-30 20:24:38 +02:00
parent d654d2d0ac
commit 2e5491604b
5 changed files with 54 additions and 2 deletions

View File

@@ -56,6 +56,10 @@ void AnimationsSystem::Job(int32 index)
auto animatedModel = UpdateList[index]; auto animatedModel = UpdateList[index];
auto skinnedModel = animatedModel->SkinnedModel.Get(); auto skinnedModel = animatedModel->SkinnedModel.Get();
auto graph = animatedModel->AnimationGraph.Get(); auto graph = animatedModel->AnimationGraph.Get();
#if COMPILE_WITH_PROFILER && TRACY_ENABLE
const StringView graphName(graph->GetPath());
ZoneName(*graphName, graphName.Length());
#endif
if (graph && graph->IsLoaded() && graph->Graph.CanUseWithSkeleton(skinnedModel) if (graph && graph->IsLoaded() && graph->Graph.CanUseWithSkeleton(skinnedModel)
#if USE_EDITOR #if USE_EDITOR
&& graph->Graph.Parameters.Count() == animatedModel->GraphInstance.Parameters.Count() // It may happen in editor so just add safe check to prevent any crashes && graph->Graph.Parameters.Count() == animatedModel->GraphInstance.Parameters.Count() // It may happen in editor so just add safe check to prevent any crashes

View File

@@ -149,6 +149,7 @@ Variant AnimGraphExecutor::SampleAnimation(AnimGraphNode* node, bool loop, float
// Skip if animation is not ready to use // Skip if animation is not ready to use
if (anim == nullptr || !anim->IsLoaded()) if (anim == nullptr || !anim->IsLoaded())
return Value::Null; return Value::Null;
PROFILE_CPU_ASSET(anim);
// Calculate actual time position within the animation node (defined by length and loop mode) // Calculate actual time position within the animation node (defined by length and loop mode)
const float pos = GetAnimPos(newTimePos, startTimePos, loop, length); const float pos = GetAnimPos(newTimePos, startTimePos, loop, length);
@@ -607,8 +608,6 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu
// Animation // Animation
case 0: case 0:
{ {
ANIM_GRAPH_PROFILE_EVENT("Sample");
const float length = anim ? anim->GetLength() : 0.0f; const float length = anim ? anim->GetLength() : 0.0f;
// Calculate new time position // Calculate new time position

View File

@@ -14,6 +14,15 @@
#define RAND3 Vector3(RAND, RAND, RAND) #define RAND3 Vector3(RAND, RAND, RAND)
#define RAND4 Vector4(RAND, RAND, RAND, RAND) #define RAND4 Vector4(RAND, RAND, RAND, RAND)
// Enable to insert CPU profiler events for particles modules
#define PARTICLE_EMITTER_MODULES_PROFILE 0
#if PARTICLE_EMITTER_MODULES_PROFILE
#include "Engine/Profiler/ProfilerCPU.h"
#define PARTICLE_EMITTER_MODULE(name) PROFILE_CPU_NAMED(name)
#else
#define PARTICLE_EMITTER_MODULE(name)
#endif
namespace namespace
{ {
FORCE_INLINE Vector4 Mod289(Vector4 x) FORCE_INLINE Vector4 Mod289(Vector4 x)
@@ -181,6 +190,7 @@ void ParticleEmitterGraphCPUExecutor::ProcessModule(ParticleEmitterGraphCPUNode*
case 201: case 201:
case 303: case 303:
{ {
PARTICLE_EMITTER_MODULE("Orient Sprite");
auto spriteFacingMode = node->Values[2].AsInt; auto spriteFacingMode = node->Values[2].AsInt;
{ {
auto& attribute = context.Data->Buffer->Layout->Attributes[node->Attributes[0]]; auto& attribute = context.Data->Buffer->Layout->Attributes[node->Attributes[0]];
@@ -223,6 +233,7 @@ void ParticleEmitterGraphCPUExecutor::ProcessModule(ParticleEmitterGraphCPUNode*
case 213: case 213:
case 309: case 309:
{ {
PARTICLE_EMITTER_MODULE("Orient Model");
auto modelFacingMode = node->Values[2].AsInt; auto modelFacingMode = node->Values[2].AsInt;
{ {
auto& attribute = context.Data->Buffer->Layout->Attributes[node->Attributes[0]]; auto& attribute = context.Data->Buffer->Layout->Attributes[node->Attributes[0]];
@@ -238,6 +249,7 @@ void ParticleEmitterGraphCPUExecutor::ProcessModule(ParticleEmitterGraphCPUNode*
// Update Age // Update Age
case 300: case 300:
{ {
PARTICLE_EMITTER_MODULE("Update Age");
auto& attribute = context.Data->Buffer->Layout->Attributes[node->Attributes[0]]; auto& attribute = context.Data->Buffer->Layout->Attributes[node->Attributes[0]];
byte* agePtr = start + attribute.Offset; byte* agePtr = start + attribute.Offset;
for (int32 particleIndex = particlesStart; particleIndex < particlesEnd; particleIndex++) for (int32 particleIndex = particlesStart; particleIndex < particlesEnd; particleIndex++)
@@ -251,6 +263,7 @@ void ParticleEmitterGraphCPUExecutor::ProcessModule(ParticleEmitterGraphCPUNode*
case 301: case 301:
case 304: case 304:
{ {
PARTICLE_EMITTER_MODULE("Gravity/Force");
auto& attribute = context.Data->Buffer->Layout->Attributes[node->Attributes[0]]; auto& attribute = context.Data->Buffer->Layout->Attributes[node->Attributes[0]];
byte* velocityPtr = start + attribute.Offset; byte* velocityPtr = start + attribute.Offset;
auto box = node->GetBox(0); auto box = node->GetBox(0);
@@ -278,6 +291,7 @@ void ParticleEmitterGraphCPUExecutor::ProcessModule(ParticleEmitterGraphCPUNode*
// Conform to Sphere // Conform to Sphere
case 305: case 305:
{ {
PARTICLE_EMITTER_MODULE("Conform to Sphere");
auto& position = context.Data->Buffer->Layout->Attributes[node->Attributes[0]]; auto& position = context.Data->Buffer->Layout->Attributes[node->Attributes[0]];
auto& velocity = context.Data->Buffer->Layout->Attributes[node->Attributes[1]]; auto& velocity = context.Data->Buffer->Layout->Attributes[node->Attributes[1]];
auto& mass = context.Data->Buffer->Layout->Attributes[node->Attributes[2]]; auto& mass = context.Data->Buffer->Layout->Attributes[node->Attributes[2]];
@@ -340,6 +354,7 @@ void ParticleEmitterGraphCPUExecutor::ProcessModule(ParticleEmitterGraphCPUNode*
// Kill (sphere) // Kill (sphere)
case 306: case 306:
{ {
PARTICLE_EMITTER_MODULE("Kill");
auto& position = context.Data->Buffer->Layout->Attributes[node->Attributes[0]]; auto& position = context.Data->Buffer->Layout->Attributes[node->Attributes[0]];
byte* positionPtr = start + position.Offset; byte* positionPtr = start + position.Offset;
@@ -388,6 +403,7 @@ void ParticleEmitterGraphCPUExecutor::ProcessModule(ParticleEmitterGraphCPUNode*
// Kill (box) // Kill (box)
case 307: case 307:
{ {
PARTICLE_EMITTER_MODULE("Kill");
auto& position = context.Data->Buffer->Layout->Attributes[node->Attributes[0]]; auto& position = context.Data->Buffer->Layout->Attributes[node->Attributes[0]];
byte* positionPtr = start + position.Offset; byte* positionPtr = start + position.Offset;
@@ -441,6 +457,7 @@ void ParticleEmitterGraphCPUExecutor::ProcessModule(ParticleEmitterGraphCPUNode*
// Kill (custom) // Kill (custom)
case 308: case 308:
{ {
PARTICLE_EMITTER_MODULE("Kill (custom)");
auto killBox = node->GetBox(0); auto killBox = node->GetBox(0);
#define INPUTS_FETCH() \ #define INPUTS_FETCH() \
@@ -478,6 +495,7 @@ void ParticleEmitterGraphCPUExecutor::ProcessModule(ParticleEmitterGraphCPUNode*
// Linear Drag // Linear Drag
case 310: case 310:
{ {
PARTICLE_EMITTER_MODULE("Linear Drag");
auto box = node->GetBox(0); auto box = node->GetBox(0);
const bool useSpriteSize = node->Values[3].AsBool; const bool useSpriteSize = node->Values[3].AsBool;
@@ -523,6 +541,7 @@ void ParticleEmitterGraphCPUExecutor::ProcessModule(ParticleEmitterGraphCPUNode*
// Turbulence // Turbulence
case 311: case 311:
{ {
PARTICLE_EMITTER_MODULE("Turbulence");
auto& position = context.Data->Buffer->Layout->Attributes[node->Attributes[0]]; auto& position = context.Data->Buffer->Layout->Attributes[node->Attributes[0]];
auto& velocity = context.Data->Buffer->Layout->Attributes[node->Attributes[1]]; auto& velocity = context.Data->Buffer->Layout->Attributes[node->Attributes[1]];
auto& mass = context.Data->Buffer->Layout->Attributes[node->Attributes[2]]; auto& mass = context.Data->Buffer->Layout->Attributes[node->Attributes[2]];
@@ -583,6 +602,7 @@ void ParticleEmitterGraphCPUExecutor::ProcessModule(ParticleEmitterGraphCPUNode*
case 200: case 200:
case 302: case 302:
{ {
PARTICLE_EMITTER_MODULE("Set Attribute");
auto& attribute = context.Data->Buffer->Layout->Attributes[node->Attributes[0]]; auto& attribute = context.Data->Buffer->Layout->Attributes[node->Attributes[0]];
byte* dataPtr = start + attribute.Offset; byte* dataPtr = start + attribute.Offset;
int32 dataSize = attribute.GetSize(); int32 dataSize = attribute.GetSize();
@@ -639,6 +659,7 @@ void ParticleEmitterGraphCPUExecutor::ProcessModule(ParticleEmitterGraphCPUNode*
case 362: case 362:
case 363: case 363:
{ {
PARTICLE_EMITTER_MODULE("Set");
auto& attribute = context.Data->Buffer->Layout->Attributes[node->Attributes[0]]; auto& attribute = context.Data->Buffer->Layout->Attributes[node->Attributes[0]];
byte* dataPtr = start + attribute.Offset; byte* dataPtr = start + attribute.Offset;
int32 dataSize = attribute.GetSize(); int32 dataSize = attribute.GetSize();
@@ -668,6 +689,7 @@ void ParticleEmitterGraphCPUExecutor::ProcessModule(ParticleEmitterGraphCPUNode*
// Position (sphere surface) // Position (sphere surface)
case 202: case 202:
{ {
PARTICLE_EMITTER_MODULE("Position");
auto& positionAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[0]]; auto& positionAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[0]];
byte* positionPtr = start + positionAttr.Offset; byte* positionPtr = start + positionAttr.Offset;
@@ -713,6 +735,7 @@ void ParticleEmitterGraphCPUExecutor::ProcessModule(ParticleEmitterGraphCPUNode*
// Position (plane) // Position (plane)
case 203: case 203:
{ {
PARTICLE_EMITTER_MODULE("Position");
auto& positionAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[0]]; auto& positionAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[0]];
byte* positionPtr = start + positionAttr.Offset; byte* positionPtr = start + positionAttr.Offset;
@@ -751,6 +774,7 @@ void ParticleEmitterGraphCPUExecutor::ProcessModule(ParticleEmitterGraphCPUNode*
// Position (circle) // Position (circle)
case 204: case 204:
{ {
PARTICLE_EMITTER_MODULE("Position");
auto& positionAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[0]]; auto& positionAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[0]];
byte* positionPtr = start + positionAttr.Offset; byte* positionPtr = start + positionAttr.Offset;
@@ -794,6 +818,7 @@ void ParticleEmitterGraphCPUExecutor::ProcessModule(ParticleEmitterGraphCPUNode*
// Position (disc) // Position (disc)
case 205: case 205:
{ {
PARTICLE_EMITTER_MODULE("Position");
auto& positionAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[0]]; auto& positionAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[0]];
byte* positionPtr = start + positionAttr.Offset; byte* positionPtr = start + positionAttr.Offset;
@@ -837,6 +862,7 @@ void ParticleEmitterGraphCPUExecutor::ProcessModule(ParticleEmitterGraphCPUNode*
// Position (box surface) // Position (box surface)
case 206: case 206:
{ {
PARTICLE_EMITTER_MODULE("Position");
auto& positionAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[0]]; auto& positionAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[0]];
byte* positionPtr = start + positionAttr.Offset; byte* positionPtr = start + positionAttr.Offset;
@@ -887,6 +913,7 @@ void ParticleEmitterGraphCPUExecutor::ProcessModule(ParticleEmitterGraphCPUNode*
// Position (box volume) // Position (box volume)
case 207: case 207:
{ {
PARTICLE_EMITTER_MODULE("Position");
auto& positionAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[0]]; auto& positionAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[0]];
byte* positionPtr = start + positionAttr.Offset; byte* positionPtr = start + positionAttr.Offset;
@@ -925,6 +952,7 @@ void ParticleEmitterGraphCPUExecutor::ProcessModule(ParticleEmitterGraphCPUNode*
// Position (cylinder) // Position (cylinder)
case 208: case 208:
{ {
PARTICLE_EMITTER_MODULE("Position");
auto& positionAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[0]]; auto& positionAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[0]];
byte* positionPtr = start + positionAttr.Offset; byte* positionPtr = start + positionAttr.Offset;
@@ -970,6 +998,7 @@ void ParticleEmitterGraphCPUExecutor::ProcessModule(ParticleEmitterGraphCPUNode*
// Position (line) // Position (line)
case 209: case 209:
{ {
PARTICLE_EMITTER_MODULE("Position");
auto& positionAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[0]]; auto& positionAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[0]];
byte* positionPtr = start + positionAttr.Offset; byte* positionPtr = start + positionAttr.Offset;
@@ -1008,6 +1037,7 @@ void ParticleEmitterGraphCPUExecutor::ProcessModule(ParticleEmitterGraphCPUNode*
// Position (torus) // Position (torus)
case 210: case 210:
{ {
PARTICLE_EMITTER_MODULE("Position");
auto& positionAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[0]]; auto& positionAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[0]];
byte* positionPtr = start + positionAttr.Offset; byte* positionPtr = start + positionAttr.Offset;
@@ -1072,6 +1102,7 @@ void ParticleEmitterGraphCPUExecutor::ProcessModule(ParticleEmitterGraphCPUNode*
// Position (sphere volume) // Position (sphere volume)
case 211: case 211:
{ {
PARTICLE_EMITTER_MODULE("Position");
auto& positionAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[0]]; auto& positionAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[0]];
byte* positionPtr = start + positionAttr.Offset; byte* positionPtr = start + positionAttr.Offset;
@@ -1123,6 +1154,7 @@ void ParticleEmitterGraphCPUExecutor::ProcessModule(ParticleEmitterGraphCPUNode*
// Position (spiral) // Position (spiral)
case 214: case 214:
{ {
PARTICLE_EMITTER_MODULE("Position");
auto& positionAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[0]]; auto& positionAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[0]];
auto& velocityAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[1]]; auto& velocityAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[1]];
@@ -1173,6 +1205,7 @@ void ParticleEmitterGraphCPUExecutor::ProcessModule(ParticleEmitterGraphCPUNode*
// Helper macros for collision modules to share the code // Helper macros for collision modules to share the code
#define COLLISION_BEGIN() \ #define COLLISION_BEGIN() \
PARTICLE_EMITTER_MODULE("Collision"); \
auto& positionAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[0]]; \ auto& positionAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[0]]; \
auto& velocityAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[1]]; \ auto& velocityAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[1]]; \
auto& ageAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[2]]; \ auto& ageAttr = context.Data->Buffer->Layout->Attributes[node->Attributes[2]]; \

View File

@@ -6,6 +6,7 @@
#include "Engine/Renderer/RenderList.h" #include "Engine/Renderer/RenderList.h"
#include "Engine/Particles/ParticleEffect.h" #include "Engine/Particles/ParticleEffect.h"
#include "Engine/Engine/Time.h" #include "Engine/Engine/Time.h"
#include "Engine/Profiler/ProfilerCPU.h"
ThreadLocal<ParticleEmitterGraphCPUContext> ParticleEmitterGraphCPUExecutor::Context; ThreadLocal<ParticleEmitterGraphCPUContext> ParticleEmitterGraphCPUExecutor::Context;
@@ -433,6 +434,7 @@ void ParticleEmitterGraphCPUExecutor::Update(ParticleEmitter* emitter, ParticleE
// Update particles // Update particles
if (cpu.Count > 0) if (cpu.Count > 0)
{ {
PROFILE_CPU_NAMED("Update");
for (int32 i = 0; i < _graph.UpdateModules.Count(); i++) for (int32 i = 0; i < _graph.UpdateModules.Count(); i++)
{ {
ProcessModule(_graph.UpdateModules[i], 0, cpu.Count); ProcessModule(_graph.UpdateModules[i], 0, cpu.Count);
@@ -442,6 +444,7 @@ void ParticleEmitterGraphCPUExecutor::Update(ParticleEmitter* emitter, ParticleE
// Dead particles removal // Dead particles removal
if (_graph._attrAge != -1 && _graph._attrLifetime != -1) if (_graph._attrAge != -1 && _graph._attrLifetime != -1)
{ {
PROFILE_CPU_NAMED("Age kill");
byte* agePtr = cpu.Buffer.Get() + data.Buffer->Layout->Attributes[_graph._attrAge].Offset; byte* agePtr = cpu.Buffer.Get() + data.Buffer->Layout->Attributes[_graph._attrAge].Offset;
byte* lifetimePtr = cpu.Buffer.Get() + data.Buffer->Layout->Attributes[_graph._attrLifetime].Offset; byte* lifetimePtr = cpu.Buffer.Get() + data.Buffer->Layout->Attributes[_graph._attrLifetime].Offset;
for (int32 particleIndex = 0; particleIndex < cpu.Count; particleIndex++) for (int32 particleIndex = 0; particleIndex < cpu.Count; particleIndex++)
@@ -477,6 +480,7 @@ void ParticleEmitterGraphCPUExecutor::Update(ParticleEmitter* emitter, ParticleE
// Euler integration // Euler integration
if (_graph._attrPosition != -1 && _graph._attrVelocity != -1) if (_graph._attrPosition != -1 && _graph._attrVelocity != -1)
{ {
PROFILE_CPU_NAMED("Euler Integration");
byte* positionPtr = cpu.Buffer.Get() + data.Buffer->Layout->Attributes[_graph._attrPosition].Offset; byte* positionPtr = cpu.Buffer.Get() + data.Buffer->Layout->Attributes[_graph._attrPosition].Offset;
byte* velocityPtr = cpu.Buffer.Get() + data.Buffer->Layout->Attributes[_graph._attrVelocity].Offset; byte* velocityPtr = cpu.Buffer.Get() + data.Buffer->Layout->Attributes[_graph._attrVelocity].Offset;
for (int32 particleIndex = 0; particleIndex < cpu.Count; particleIndex++) for (int32 particleIndex = 0; particleIndex < cpu.Count; particleIndex++)
@@ -490,6 +494,7 @@ void ParticleEmitterGraphCPUExecutor::Update(ParticleEmitter* emitter, ParticleE
// Angular Euler Integration // Angular Euler Integration
if (_graph._attrRotation != -1 && _graph._attrAngularVelocity != -1) if (_graph._attrRotation != -1 && _graph._attrAngularVelocity != -1)
{ {
PROFILE_CPU_NAMED("Angular Euler Integration");
byte* rotationPtr = cpu.Buffer.Get() + data.Buffer->Layout->Attributes[_graph._attrRotation].Offset; byte* rotationPtr = cpu.Buffer.Get() + data.Buffer->Layout->Attributes[_graph._attrRotation].Offset;
byte* angularVelocityPtr = cpu.Buffer.Get() + data.Buffer->Layout->Attributes[_graph._attrAngularVelocity].Offset; byte* angularVelocityPtr = cpu.Buffer.Get() + data.Buffer->Layout->Attributes[_graph._attrAngularVelocity].Offset;
for (int32 particleIndex = 0; particleIndex < cpu.Count; particleIndex++) for (int32 particleIndex = 0; particleIndex < cpu.Count; particleIndex++)
@@ -504,6 +509,7 @@ void ParticleEmitterGraphCPUExecutor::Update(ParticleEmitter* emitter, ParticleE
int32 spawnCount = 0; int32 spawnCount = 0;
if (canSpawn) if (canSpawn)
{ {
PROFILE_CPU_NAMED("Spawn");
for (int32 i = 0; i < _graph.SpawnModules.Count(); i++) for (int32 i = 0; i < _graph.SpawnModules.Count(); i++)
{ {
spawnCount += ProcessSpawnModule(i); spawnCount += ProcessSpawnModule(i);
@@ -514,6 +520,8 @@ void ParticleEmitterGraphCPUExecutor::Update(ParticleEmitter* emitter, ParticleE
spawnCount = countAfter - countBefore; spawnCount = countAfter - countBefore;
if (spawnCount != 0) if (spawnCount != 0)
{ {
PROFILE_CPU_NAMED("Init");
// Spawn particles // Spawn particles
data.Buffer->CPU.Count = countAfter; data.Buffer->CPU.Count = countAfter;
@@ -533,6 +541,7 @@ void ParticleEmitterGraphCPUExecutor::Update(ParticleEmitter* emitter, ParticleE
if (_graph.RibbonRenderingModules.HasItems()) if (_graph.RibbonRenderingModules.HasItems())
{ {
// Sort ribbon particles // Sort ribbon particles
PROFILE_CPU_NAMED("Ribbon");
if (cpu.RibbonOrder.IsEmpty()) if (cpu.RibbonOrder.IsEmpty())
{ {
cpu.RibbonOrder.Resize(_graph.RibbonRenderingModules.Count() * data.Buffer->Capacity); cpu.RibbonOrder.Resize(_graph.RibbonRenderingModules.Count() * data.Buffer->Capacity);
@@ -559,6 +568,8 @@ void ParticleEmitterGraphCPUExecutor::Update(ParticleEmitter* emitter, ParticleE
int32 ParticleEmitterGraphCPUExecutor::UpdateSpawn(ParticleEmitter* emitter, ParticleEffect* effect, ParticleEmitterInstance& data, float dt) int32 ParticleEmitterGraphCPUExecutor::UpdateSpawn(ParticleEmitter* emitter, ParticleEffect* effect, ParticleEmitterInstance& data, float dt)
{ {
PROFILE_CPU_NAMED("Spawn");
// Prepare data // Prepare data
auto& context = Context.Get(); auto& context = Context.Get();
Init(emitter, effect, data, dt); Init(emitter, effect, data, dt);

View File

@@ -1211,6 +1211,10 @@ void ParticlesSystem::Job(int32 index)
} }
if (anyEmitterNotReady) if (anyEmitterNotReady)
return; return;
#if COMPILE_WITH_PROFILER && TRACY_ENABLE
const StringView particleSystemName(particleSystem->GetPath());
ZoneName(*particleSystemName, particleSystemName.Length());
#endif
// Prepare instance data // Prepare instance data
instance.Sync(particleSystem); instance.Sync(particleSystem);
@@ -1287,6 +1291,7 @@ void ParticlesSystem::Job(int32 index)
auto& data = instance.Emitters[track.AsEmitter.Index]; auto& data = instance.Emitters[track.AsEmitter.Index];
ASSERT(emitter && emitter->IsLoaded()); ASSERT(emitter && emitter->IsLoaded());
ASSERT(emitter->Capacity != 0 && emitter->Graph.Layout.Size != 0); ASSERT(emitter->Capacity != 0 && emitter->Graph.Layout.Size != 0);
PROFILE_CPU_ASSET(emitter);
// Calculate new time position // Calculate new time position
const float startTime = (float)track.AsEmitter.StartFrame / fps; const float startTime = (float)track.AsEmitter.StartFrame / fps;