D3D11 Multithreaded Renderer Device Context Question

Started by
2 comments, last by ErnieDingo 6 years, 9 months ago

When I create a multithreaded renderer for DX11 applications, do I create a separate device context for each individual thread? If I had 4 threads, each thread would have its own device context. If Yes, how do I create more than 1 device context using D3D11CreateDeviceAndSwapChain?

Thanks

Jack

Advertisement

You're probably looking for ID3D11Device::CreateDeferredContext. You should also check out the Immediate and Deferred Rendering topic.

Just some other things to consider also having been through this multi threaded process in direct x 11:

  • Device support for deferred contexts, on older AMD hardware this doesn't exist so the deferred context will be emulated.  So you may get an improvement in performance, but as usual depending on hardware configuration.  Also,  multithreaded resource creation I found was equally important.
  • Also read up on command lists as part of your deferred contexts (i assume you have anyway :))
  • When using Deferred contexts for multi-threaded rendering, the command list your thread creates needs to be executed in the main thread against the immediate context.
  • Each deferred context you will need to set up render target, blend state, rasterization viewport etc each frames.

All of that im sure if covered on a myriad of tutorials, these are the things that stick out when doing multi-threaded.

Indie game developer - Game WIP

Strafe (Working Title) - Currently in need of another developer and modeler/graphic artist (professional & amateur's artists welcome)

Insane Software Facebook

This topic is closed to new replies.

Advertisement