Graphics Reference
In-Depth Information
Figure 13.14. Processing our rendering operations in parallel. This depiction assumes that there are four
CPU cores available in this scenario.
the other, effectively creating one long chain of operations. After all of these rendering
passes were complete, the final rendering pass could be performed. By performing all of
these operations serially, we need to execute (n+ 1 )*m rendering operations, where n is the
number of reflective objects in the scene, and m is the number of objects in the scene (both
reflective and non-reflective).
By having multiple threads to process all of the various rendering passes, we can take
one complete rendering pass and process it in a separate thread to produce a command list.
The command list can then be executed on the main rendering thread in an efficient man-
ner. This effectively reduces the CPU costs of the draw submission portion of the scene by
a factor that is proportional to the number of CPU cores on the user's computer. 7 Of course,
there will be some overhead associated with creating and processing the command list
objects, but with a sufficiently large scene (a sufficiently large number of rendering opera-
tions), we would expect to see a performance improvement. This parallel processing of our
scene is depicted in Figure 13.14.
7 Of course, many factors influence the performance of a particular computer system, especially when multi-
threading is involved. The memory configuration is quite important, as well as the amount of other work that is
being done by other threads. However, if all other things are equal, we will assume that processing the drawing
operations in parallel will reduce their overall cost by a factor proportional to the number of CPU cores.
Search WWH ::




Custom Search