Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating multiple command pools per thread in Vulkan

I am trying to set up a multi-threaded renderer with Vulkan and I have a question about command pools.

Here https://on-demand.gputechconf.com/siggraph/2016/video/sig1625-tristan-lorach-vulkan-nvidia-essentials.mp4 at 13 minutes, they talk about how you should make 1 command pool per FRAME and cycle them in a ring buffer. enter image description here

Why allocate 3 command pools per thread(one for each frame in a 3-frame ring buffer) instead of having just one command pool per thread and having 3 command buffers from it?

like image 509
ulak blade Avatar asked Nov 22 '18 22:11

ulak blade


1 Answers

I think the premise here is that vkResetCommandPool is better than resetting individual command buffers. Which also requires VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT flag, whose existence is a little hint by the Specification itself that the ability to reset individual cmdbuffers may not be for free.

Actually the speaker says so if you do not just read slides but get the full presentation.

like image 81
krOoze Avatar answered Sep 28 '22 23:09

krOoze