Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Suggestion / Idea  Schedule Cloth Jobs in Update and Complete in Late Update
#2
(11-02-2022, 02:07 PM)flow____ Wrote: Hey I've written a custom Cloth Update script, it works perfectly fine, but it takes around 6ms to complete in the current frame....

Is there a way to schedule the jobs in Update and Complete it in Late Update to minimize the waiting time?

Hi!

You should be able to store a reference to the JobHandle returned by the solvers, and call Complete() in LateUpdate(). Note however that this will just kick the jobs in LateUpdate(), (scheduling a job does not guarantee it will begin execution immediately) so there’s a pretty big chance you will gain nothing performance wise.

When using the Burst backend, you can call ScheduleBatchedJobs() to force any scheduled jobs to start executing even if Complete() hasn’t been called yet.
Reply


Messages In This Thread
RE: Schedule Cloth Jobs in Update and Complete in Late Update - by josemendez - 11-02-2022, 04:15 PM