Book Image

Direct3D Rendering Cookbook

By : Justin Stenning, Justin Stenning
Book Image

Direct3D Rendering Cookbook

By: Justin Stenning, Justin Stenning

Overview of this book

Table of Contents (19 chapters)
Direct3D Rendering Cookbook
About the Author
About the Reviewers
Further Reading


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...