rend3 icon indicating copy to clipboard operation
rend3 copied to clipboard

Feature request: Separate committing instructions from executing them, to improve concurrency.

Open John-Nagle opened this issue 2 years ago • 0 comments

render.ready() first swaps the instruction list, then starts processing instructions. The swap is fast, the instruction processing is slower.

It's common to have a system where other threads update the state for the next frame, mostly changing object positions. (Unreal Engine does this). Those threads need a "go" signal as soon as it's safe to start on the next frame. That's right after the instruction list has been swapped. Waiting until all instructions have been processed slows down updating, and can result in a frame miss.

So I'm asking that render.ready() be split by adding render.commit(), which just does the buffer swap and notes that's been done. Keep render.ready(), and if a buffer swap hasn't been done yet, do it then, for backwards compatibility.

Calling render.commit() twice before calling render.ready() would lose instructions, so that's an error.

Low priority. Performance related.

John-Nagle avatar May 13 '22 03:05 John-Nagle