fix: crash occurs when too many vertices are rendered

mob-sakai 2023-08-14 15:33:19 +09:00
parent 52f2ef1f24
commit c75ca8663f
1 changed files with 12 additions and 0 deletions

View File

@ -276,6 +276,18 @@ namespace Coffee.UIExtensions
{
s_CombineInstances[0].mesh.Clear(false);
}
// Too many vertices to render.
if (65535 <= s_CombineInstances[0].mesh.vertexCount)
{
s_CombineInstances[0].mesh.Clear(false);
UnityEngine.Debug.LogErrorFormat(this,
"Too many vertices to render. index={0}, isTrail={1}, vertexCount={2}(>=65535)",
_index,
_isTrail,
s_CombineInstances[0].mesh.vertexCount
);
}
Profiler.EndSample();
// Combine mesh to transform. ([ParticleSystem local ->] world -> renderer local)