Book Image

Direct3D Rendering Cookbook

Book Image

Direct3D Rendering Cookbook

Overview of this book

Table of Contents (19 chapters)
Direct3D Rendering Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Further Reading
Index

Benchmarking multithreaded rendering


In this recipe, we will introduce multithreaded rendering techniques and implement a simple benchmark application to analyze the performance of using multiple deferred contexts. We will render the same model multiple times, comparing the results between varying numbers of deferred contexts and the immediate context. We will introduce additional CPU processing overhead to compare GPU-bound and CPU-bound frame times.

Getting ready

We can begin with any completed rendering loop and apply the techniques presented in this recipe to it. However, for the purpose of this recipe, we will assume a starting point based upon the finished result from the Animating bones recipe in Chapter 4, Animating Meshes with Vertex Skinning.

How to do it…

In order to support multithreaded rendering, it is necessary to pass the DeviceContext deferred context instance that will receive the rendering commands for the renderer. We will implement support for starting a new thread for each...