Add memory profiler category for Cloth
This commit is contained in:
@@ -133,7 +133,7 @@ Array<Float3> Cloth::GetParticles() const
|
||||
if (_cloth)
|
||||
{
|
||||
PROFILE_CPU();
|
||||
PROFILE_MEM(Physics);
|
||||
PROFILE_MEM(PhysicsCloth);
|
||||
PhysicsBackend::LockClothParticles(_cloth);
|
||||
const Span<const Float4> particles = PhysicsBackend::GetClothParticles(_cloth);
|
||||
result.Resize(particles.Length());
|
||||
@@ -150,7 +150,7 @@ Array<Float3> Cloth::GetParticles() const
|
||||
void Cloth::SetParticles(Span<const Float3> value)
|
||||
{
|
||||
PROFILE_CPU();
|
||||
PROFILE_MEM(Physics);
|
||||
PROFILE_MEM(PhysicsCloth);
|
||||
#if USE_CLOTH_SANITY_CHECKS
|
||||
{
|
||||
// Sanity check
|
||||
@@ -180,7 +180,7 @@ Span<float> Cloth::GetPaint() const
|
||||
void Cloth::SetPaint(Span<const float> 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<float>& 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<const Float4> particles = PhysicsBackend::GetClothParticles(_cloth);
|
||||
auto vbCount = (uint32)mesh->GetVertexCount();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -120,6 +120,8 @@ public:
|
||||
|
||||
// Total physics memory.
|
||||
Physics,
|
||||
// Cloth simulation and particles data.
|
||||
PhysicsCloth,
|
||||
|
||||
// Total scripting memory allocated by game.
|
||||
Scripting,
|
||||
|
||||
Reference in New Issue
Block a user