[D3D12]FrontoBack rendering and multi-threaded rendering

Started by
15 comments, last by Dingleberry 8 years, 3 months ago


Are there any other options?
Sure, you can use many GPU queues, and then use fences on the GPU side to synchronize them, but that's a lot of extra overhead.

You could also pass ownership of the your single GPU queue from thread to thread, so that the thread processing the first range of your list performs it's own submission, then the thread that owns the 2nd range performs it's submission, etc... IMHO that would be much more complex and require more synch work than just having N write-command-list jobs, followed by a single submit job with a dependency between them. The latter should easily fit into any modern engine's job system.

Advertisement


IMHO that would be much more complex and require more synch work than just having N write-command-list jobs, followed by a single submit job with a dependency between them.

http://www.gamedev.net/topic/673336-dx12-m-commandallocator-reset-is-necessary-every-frame/

In this thread Sergio J. de los Santos seems convinced that in D3D12 commandlist building is cheap but submission is expensive. I haven't confirmed this yet but if true wouldn't overloading one thread with submission be suboptimal?

-potential energy is easily made kinetic-


In this thread Sergio J. de los Santos seems convinced that in D3D12 commandlist building is cheap but submission is expensive. I haven't confirmed this yet but if true wouldn't overloading one thread with submission be suboptimal?
Putting commands into a cmd list is cheap, but you do it tens of thousands of times per frame. Submission is "expensive" for a single function call (similar to typical function calls in older D3D versions :P) but you do it a handful of times per frame.

Sure, you can use many GPU queues, and then use fences on the GPU side to synchronize them, but that's a lot of extra overhead.

Just to clarify, the dx12 multithreaded sample is generating command lists in multiple threads so all the gpu commands are still executed in order (by list and then command), while the multiadapter sample uses different gpu queues and executes two sets of commands concurrently, right? Is it ever useful to have multiple Gpu queues on a single adapter? I thought that on Nvidia cards it isn't even very useful to have a separate Gpu/Compute queue on the same adapter. It's weird though because I'm pretty sure cuda allows concurrent execution of different kernels.


Putting commands into a cmd list is cheap, but you do it tens of thousands of times per frame. Submission is "expensive" for a single function call (similar to typical function calls in older D3D versions ) but you do it a handful of times per frame.

But will submitting all cmdlists through a single processor/thread reduce the number of draw calls from there maximums? Just curious.

-potential energy is easily made kinetic-

Submitting the command lists is the quick bit, you can even submit multiple command lists in a single call to ExecuteCommandLists. It's unlikely to have any material effect on how many draw calls you can make per second.

Adam Miles - Principal Software Development Engineer - Microsoft Xbox Advanced Technology Group

Unless you're putting one draw call in a command list and queuing a million lists I think it's kind of unnecessary to worry about submission performance. It's presumably dwarfed by the time it takes to create the lists.

This topic is closed to new replies.

Advertisement