Replies: 1 comment 1 reply
-
So your goal is to skip a specific number of frames before running a task? Keep in mind that the FPS might vary for the users, so relying on delta time/specific time intervals is more consistent. Have you tried using I think this utility might be a bit too project-specific. The current combination of |
Beta Was this translation helpful? Give feedback.
-
When I understand it correctly, that if I start an unconditional launch or async in the render loop, every frame a new job/deferred will be created.
The usual use case will be an event to start launch/async. For example an UI event or timed event.
Now, I'm using background async's at every frame for heavy calculations and syncing them when completed. Yes, it could skip frames when needed longer.
I found out that at every frame a new deferred will be created and handling them for syncing let me involve some management. For this I created a helper map which stores the deferred with a given name and checkings for completion to update it.
I wrote a little .kt for it and maybe it fits into this project. I will attach it here and maybe it want to be incorporated after review.
The use case in the render-loop is this:
It creates a named lazy launch and add's at every frame 30 random point-coodinates centered at the middle of the screen starting at frameId 100. After the named launch will be removed from the map.
In this example it creates every frame a launch but managed.
Another use-case could be to start a named lazy launch for a single event and so only one launch/async will be lazily created and executed.
What do you think about it? Or is this a edge case?
https://pastebin.com/611NsGPY
Beta Was this translation helpful? Give feedback.
All reactions