hello people o/
I have some problems with my command buffer pools and I am quite honnestly not sure why that is 😅
I'm trying to multi-thread my render graph and at the begining of each frames, I do something like this:
{
LNE_PROFILE_SCOPE("ResetThreadContexts");
uint32_t count{};
for (auto& threadContext : frameContext.ThreadContexts)
{
count++;
{
LNE_PROFILE_SCOPE("ResetCommandPool");
device.resetCommandPool(threadContext.CommandPool);
}
threadContext.IsPrimaryCommandBufferUsed = false;
threadContext.CurrentSecondaryIndex = 0;
threadContext.SecondaryCommandBuffers.clear();
}
LNE_TRACE(std::format("Num resets: {}", count));
}
device.resetFences(frameContext.WaitFence);
in single threaded context, I use only one command buffer from 1 command pool in my thread contexts since every commands are dispatched on the render thread. To multi-thread the graphics commands, I create a secondary command buffers with these flags:
beginInfo.flags = vk::CommandBufferUsageFlagBits::eRenderPassContinue | vk::CommandBufferUsageFlagBits::eOneTimeSubmit;
The problem that I have is that I followed the advice of this documentation sample: https://docs.vulkan.org/samples/latest/samples/performance/command_buffer_usage/README.html
I go from 15us for the reset of my main command pool single threaded to a whopping 600us AT LEAST FOR EACH COMMAND POOLS!!!! for the reset of each command pools that were used to create secondary buffers (perf image attached).
at the beginning, I was creating these command pools with the VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT and thought that was the problem since it wasn't recommended in the documentation sample but it didn't change anything without the flag.
Any ideas?