hanyangl5 / horizon

precompute atmospheric scattering
MIT License
7 stars 1 forks source link

Multithread Rendering #54

Closed hanyangl5 closed 1 year ago

hanyangl5 commented 2 years ago

resources:

fiber & jobsystem

https://www.gdcvault.com/play/1012321/Task-based-Multithreading-How-to https://gdcvault.com/play/1022186/Parallelizing-the-Naughty-Dog-Engine

impl

https://codereview.stackexchange.com/questions/158739/task-based-multithreading-library-implemented-using-fibers https://github.com/RichieSams/FiberTaskingLib https://wickedengine.net/2018/11/24/simple-job-system-using-standard-c/

hanyangl5 commented 2 years ago

there are two multihreading ways in Vulkan and DirectX12

multithread render passes/pass(scene)-based

cannot scale performance with cpu core counts liminited multithreading overhead due to small amount of thread sync and cmd submisiion

multihread draw calls/chunck based

this method can achieve the best performance due to good thread load balancing and multi-core performance scalability. but more thread jobs means more sync operation and submission per frame.

make the most of multicore to improve performance in all cases

Horizon

In horizon, we multihread the passes and draw calls.