Game Development Reference
In-Depth Information
Figure17.9 illustrateshowpipeliningoneframecanusedrain-outtimefrom
another frame. The empty CPU time created by taskset B, depending on the
result of taskset A, and taskset C, depending on taskset B, are utilized by the
taskset C executing from the previous frame. Note that, since the latency is two
frames, the memory footprint is smaller than the thread-per-system case while
achieving maximum throughput. The result of moving CPU pipelining to a task-
based approach is a more responsive game with a lower memory footprint.
Bringing pipelining to the tasking game engine. The rendering taskset in the
example is not really the entire process of rendering. D3D11 allows for creating
command lists on separate threads, but submission of those command lists can only
occur on the main thread. The main thread waits for the render taskset to complete
command list creation and submits the command lists. The first step to pipeline
frame submission is to double-buffer the command list array. The animation and
rendering tasksets can work on the frame
n
+ 1, while the main thread submits
frame
. Each system selects which buffer to use based on whether the frame is
odd or even, ensuring that each taskset works on the data for the correct frame
without heavy OS synchronization. Finally, the submit code skips the first frame
rendered since there are no command lists to submit.
n
Figure 17.10. TGE with pipelined frame submit.
 
Search WWH ::




Custom Search