What was your primary source of knowledge for multi-threaded rendering in DX11?

Mar 30, 2013 at 2:20 PM
I remember not managing to get it to work in the past(mainly due to lack of threading knowledge), but also because it was no very well documented.Did you have a specific source on the subject prior to implementing it in your engine, or did you develop it via common knowledge?I'd like to create something similar, but with a more "global" threading system that applies to all modules in the program which use "Task" objects.
Mar 30, 2013 at 2:57 PM
It was primarily based on past experience, samples in the DXSDK, and some trial and error. Long ago I wrote a software renderer that mimicked the hardware rendering pipeline, and I used multithreading to try to speed it up. That really makes you think about access patterns, and consider what you can do in each phase of the execution.

Another great 'practice' resource is working on Compute Shaders. It doesn't get any more threaded than working with hundreds of threads on one dataset, so this was also good practice to understand how I needed to separate the update and consume portions of the engine.

Regarding the documentation, it was very scattered, especially when I was writing the chapter on multithreaded rendering. I pieced it together from various places across the web, and wasn't afraid to ask questions.

The system that you mentioned about the 'Task' being accessible globally is more or less where I am going with the engine. I can envision eventually breaking the classes into a GPUTask and a CPUTask, and then using them accordingly. In general, everything in Hieroglyph at the moment that is a subclass of Task is aimed at GPU tasks, but in the future things like this could be moved back and forth. Hieroglyph has always grown organically like this, more or less following my own progression and understanding of both C++ and rendering and software design in general.

You may have noticed that over the past few months I am spending lots of time implementing template functionality. It starts off slow, and as I learn I begin doing more and more - simply because I understand it better now than I did before. I would suggest taking such an approach to your own multithreading activities - make a design work, learn what is good or bad about it, then improve, repeat, and repeat again!

And of course, if you have questions, there are people here to help you :)