Skip to content

py,st3m: Reactor: Don't make draw calls unless the drawlist is submittable

dos requested to merge latency into main

In the current graphics pipeline, only a single drawlist can be submitted to the rasterizer's queue at a time. This means that at a given time, there are two "pending" frames: the one currently rasterized, and the one placed in the queue. Once the queued frame's rasterization starts, a new frame can be queued. This means that to achieve full pipeline utilization, a new frame can be submitted anytime between the moment when the queue becomes empty and when the rasterization of the new frame finishes.

Previously, Reactor would eagerly make the draw calls as soon as a drawlist became free, setting the drawlist content in stone. Then, at the end of each think cycle, it would check whether the queue became free and submit the frame if that's the case. Since draw calls are lightweight, it usually wasn't the case right away, meaning that the already prepared drawlist would have to wait for (at least) the next think cycle until being submitted - for no actual benefit, as another frame would still be rasterized at that point of time.

Reduce latency and only make the draw calls once a drawlist becomes submittable. The worst case latency regression is a fraction of draw call duration (which usually is very short anyway), while best case improvement is frame rendering time plus think cycle time (which can be very long for heavy frames).

Merge request reports