Jump to content
  • Advertisement
Sign in to follow this  
Mr_Fox

Is it OK to give each render thread their own cmdQueue?

This topic is 967 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

MSFT MSDN recommend that each render thread record their own cmdlist, and then send these cmdlists to master render thread to be execute by master thread's cmdQueue. So is there any reason why shouldn't each render thread execute their cmdlist by giving them their own cmdQueue? since the render task will still be queued on GPU side sequentially.

Share this post


Link to post
Share on other sites
Advertisement
Typically your different command lists will have dependencies, such that you require one command list to execute completely before another can start. For instance, you need to finish rendering your G-Buffer before the GPU can start doing the deferred lighting pass. Pretty much all existing GPU's will execute your direct/graphics command lists sequentially in the order that you submit them to a queue, and so the easiest and most reliable way to ensure correct execution order is to have 1 thread wait for all other rendering threads to finish and then submit all of the command lists in the correct order. Having each render thread submit its own command list(s) in the correct order would require more complex synchronization, and would also may require multiple threads to sit around waiting for other threads to finish (as opposed to just having one "master" thread wait).

Share this post


Link to post
Share on other sites
There's also potentially a performance penalty for having multiple queues. It's a bit like over-saturating thread on the CPU; the hardware only scales up so far and after a point the contention and scheduling overhead swamps any benefit you might get.

Each command queue has a lot of things it deals with wrt to resource barriers, fences, and of course the scheduling of work on the GPU itself. Having more than you need isn't a good idea.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!