UniVRM icon indicating copy to clipboard operation
UniVRM copied to clipboard

Add IAwaitCaller.NextFrameIfTimedOut to time consuming loops

Open matsutaka-pxv opened this issue 3 years ago • 1 comments

処理の長いループ内に IAwaitCaller.NextFrameIfTimedOut を追加します。

ループ外に Profiler.Begin/EndProfile() がある場合は、ループ内に入れます。 これにより、UnityEngine がループをまたいだ Begin/EndProfile に対して警告を出すのを抑制します。

疑問点

NextFrame() とのバランスから、また、将来 continue 等のフロー制御を追加した際にも気にせず対応できるよう、できるだけループの先頭側に NextFrameIfTimedOut を追加しています。 ただ、コード全体として見たとき、これが望ましい位置なのか意見が分かれる点かもしれません。

matsutaka-pxv avatar Sep 21 '22 10:09 matsutaka-pxv

Can one of the admins verify this patch?

vrm-github-bot avatar Sep 21 '22 10:09 vrm-github-bot