diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/MeshIO/MeshImporter.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/MeshIO/MeshImporter.cs index 3e8f52268..3e0601726 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/MeshIO/MeshImporter.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/MeshIO/MeshImporter.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Runtime.InteropServices; using System.Threading.Tasks; using UnityEngine; +using UnityEngine.Profiling; using VRMShaders; namespace UniGLTF @@ -628,6 +629,8 @@ namespace UniGLTF positions = blendShape.Positions.ToArray(); normals = blendShape.Normals.ToArray(); }); + + Profiler.BeginSample("MeshImporter.BuildBlendShapeAsync"); if (blendShape.Positions.Count > 0) { if (blendShape.Positions.Count == mesh.vertexCount) @@ -653,11 +656,14 @@ namespace UniGLTF null ); } + Profiler.EndSample(); } public static async Task BuildMeshAsync(IAwaitCaller awaitCaller, Func ctx, MeshImporter.MeshContext meshContext) { + Profiler.BeginSample("MeshImporter._BuildMesh"); var (mesh, recalculateTangents) = _BuildMesh(meshContext); + Profiler.EndSample(); if (recalculateTangents) { @@ -683,7 +689,9 @@ namespace UniGLTF } } + Profiler.BeginSample("Mesh.UploadMeshData"); mesh.UploadMeshData(false); + Profiler.EndSample(); return result; }