mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-20 09:47:56 -05:00
Merge pull request #1222 from notargs/feature/add_profiler
Profiler.Begin()/End()をMeshImporterに仕込んだ
This commit is contained in:
commit
20dd002197
|
|
@ -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<MeshWithMaterials> BuildMeshAsync(IAwaitCaller awaitCaller, Func<int, Material> 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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user