SpiecsEngine
 
Loading...
Searching...
No Matches

◆ FreeParallelCommandBuffers()

void Spices::VulkanCmdThreadPool::FreeParallelCommandBuffers ( uint32_t frameIndex)

Free all second CommandBuffer in rhi threadPool thread.

Parameters
[in]frameIndexcurrent frame index.

Definition at line 199 of file VulkanCmdThreadPool.cpp.

200 {
202
203 auto& commandBuffers = m_CmdBuffers[frameIndex];
204
205 for (int i = 0; i < m_NThreads.load(); i++)
206 {
207 if (commandBuffers[i].empty()) continue;
208
209 vkFreeCommandBuffers(m_VulkanState.m_Device, m_CmdPools[i], commandBuffers[i].size(), commandBuffers[i].data());
210 commandBuffers[i].clear();
211 }
212 }
#define SPICES_PROFILE_ZONE
std::atomic_int m_NThreads
Threads Count.
std::vector< VkCommandPool > m_CmdPools
Parallel CommandPools.
std::array< std::vector< std::vector< VkCommandBuffer > >, MaxFrameInFlight > m_CmdBuffers
Parallel Secondary CommandBuffers.
VulkanState & m_VulkanState
The global VulkanState Referenced from VulkanRenderBackend.

Referenced by ~VulkanCmdThreadPool().