Graphics Reference
In-Depth Information
9
Rendering on Multiple
Threads and Deferred
Contexts
In this chapter, we will cover the following topics:
F Benchmarking multithreaded rendering
F Implementing multithreaded dynamic cubic environment mapping
F Implementing dual paraboloid environment mapping
Introduction
One of the improvements that came with Direct3D 11 is the improved multithreading support.
This is facilitated through the use of deferred contexts, additional device contexts that are
used to create a command list for future execution on the immediate context. Creating
multiple deferred contexts allow us to prepare rendering commands on multiple threads at
once, and therefore, take advantage of multiple CPU cores that are common on modern PCs.
In this chapter, we will look at how to implement multithreaded rendering and take a look at
the impact on performance and under what circumstances it can provide us with benefits.
We will then apply it to dynamic environment mapping, where we are performing multiple
scene passes per frame. We will simulate additional CPU load (or CPU burn) by introducing
additional matrix multiplications on the CPU within each thread. By increasing and decreasing
the level of CPU burn, we will examine the impact on performance with and without
multithreaded rendering enabled to gain an understanding of the circumstances in which
it is beneficial to introduce multithreaded rendering. An introduction to the immediate and
deferred contexts can be found in Chapter 1 , Getting Started with Direct3D .
Search WWH ::




Custom Search