diff --git a/Source/Engine/Physics/Actors/Cloth.cpp b/Source/Engine/Physics/Actors/Cloth.cpp index 8c9b996ce..3e0eb42d4 100644 --- a/Source/Engine/Physics/Actors/Cloth.cpp +++ b/Source/Engine/Physics/Actors/Cloth.cpp @@ -133,7 +133,7 @@ Array Cloth::GetParticles() const if (_cloth) { PROFILE_CPU(); - PROFILE_MEM(Physics); + PROFILE_MEM(PhysicsCloth); PhysicsBackend::LockClothParticles(_cloth); const Span particles = PhysicsBackend::GetClothParticles(_cloth); result.Resize(particles.Length()); @@ -150,7 +150,7 @@ Array Cloth::GetParticles() const void Cloth::SetParticles(Span value) { PROFILE_CPU(); - PROFILE_MEM(Physics); + PROFILE_MEM(PhysicsCloth); #if USE_CLOTH_SANITY_CHECKS { // Sanity check @@ -180,7 +180,7 @@ Span Cloth::GetPaint() const void Cloth::SetPaint(Span value) { PROFILE_CPU(); - PROFILE_MEM(Physics); + PROFILE_MEM(PhysicsCloth); #if USE_CLOTH_SANITY_CHECKS { // Sanity check @@ -312,7 +312,7 @@ void Cloth::Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) { Actor::Deserialize(stream, modifier); - PROFILE_MEM(Physics); + PROFILE_MEM(PhysicsCloth); DESERIALIZE_MEMBER(Mesh, _mesh); _mesh.Actor = nullptr; // Don't store this reference DESERIALIZE_MEMBER(Force, _forceSettings); @@ -552,7 +552,7 @@ bool Cloth::CreateCloth() { #if WITH_CLOTH PROFILE_CPU(); - PROFILE_MEM(Physics); + PROFILE_MEM(PhysicsCloth); // Skip if all vertices are fixed so cloth sim doesn't make sense if (_paint.HasItems()) @@ -658,7 +658,7 @@ void Cloth::CalculateInvMasses(MeshAccessor& accessor, Array& invMasses) if (_paint.IsEmpty()) return; PROFILE_CPU(); - PROFILE_MEM(Physics); + PROFILE_MEM(PhysicsCloth); // Get mesh data auto positions = accessor.Position(); @@ -929,7 +929,7 @@ void Cloth::RunClothDeformer(const MeshBase* mesh, MeshDeformationData& deformat return; #if WITH_CLOTH PROFILE_CPU_NAMED("Cloth"); - PROFILE_MEM(Physics); + PROFILE_MEM(PhysicsCloth); PhysicsBackend::LockClothParticles(_cloth); const Span particles = PhysicsBackend::GetClothParticles(_cloth); auto vbCount = (uint32)mesh->GetVertexCount(); diff --git a/Source/Engine/Physics/PhysX/PhysicsBackendPhysX.cpp b/Source/Engine/Physics/PhysX/PhysicsBackendPhysX.cpp index b5efa9d73..64fe6fd65 100644 --- a/Source/Engine/Physics/PhysX/PhysicsBackendPhysX.cpp +++ b/Source/Engine/Physics/PhysX/PhysicsBackendPhysX.cpp @@ -1177,6 +1177,7 @@ void ScenePhysX::UpdateVehicles(float dt) void ScenePhysX::PreSimulateCloth(int32 i) { PROFILE_CPU(); + PROFILE_MEM(PhysicsCloth); auto clothPhysX = ClothsList[i]; auto& clothSettings = Cloths[clothPhysX]; @@ -1379,6 +1380,7 @@ void ScenePhysX::UpdateCloths(float dt) if (!clothSolver || ClothsList.IsEmpty()) return; PROFILE_CPU_NAMED("Physics.Cloth"); + PROFILE_MEM(PhysicsCloth); { PROFILE_CPU_NAMED("Pre"); @@ -3994,7 +3996,7 @@ void PhysicsBackend::RemoveVehicle(void* scene, WheeledVehicle* actor) void* PhysicsBackend::CreateCloth(const PhysicsClothDesc& desc) { PROFILE_CPU(); - PROFILE_MEM(Physics); + PROFILE_MEM(PhysicsCloth); #if USE_CLOTH_SANITY_CHECKS { // Sanity check diff --git a/Source/Engine/Profiler/ProfilerMemory.cpp b/Source/Engine/Profiler/ProfilerMemory.cpp index 6b8f18ce3..eaa6cbfcd 100644 --- a/Source/Engine/Profiler/ProfilerMemory.cpp +++ b/Source/Engine/Profiler/ProfilerMemory.cpp @@ -263,6 +263,7 @@ void InitProfilerMemory(const Char* cmdLine, int32 stage) INIT_PARENT(Level, LevelTerrain); INIT_PARENT(Navigation, NavigationMesh); INIT_PARENT(Navigation, NavigationBuilding); + INIT_PARENT(Physics, PhysicsCloth); INIT_PARENT(Scripting, ScriptingVisual); INIT_PARENT(Scripting, ScriptingCSharp); INIT_PARENT(ScriptingCSharp, ScriptingCSharpGCCommitted); diff --git a/Source/Engine/Profiler/ProfilerMemory.h b/Source/Engine/Profiler/ProfilerMemory.h index 9177ae6e7..ab33a42f3 100644 --- a/Source/Engine/Profiler/ProfilerMemory.h +++ b/Source/Engine/Profiler/ProfilerMemory.h @@ -120,6 +120,8 @@ public: // Total physics memory. Physics, + // Cloth simulation and particles data. + PhysicsCloth, // Total scripting memory allocated by game. Scripting,