CommandBufferManager::~CommandBufferManager()
{
  // If the worker thread is enabled, stop and block until it exits.
  if (m_use_threaded_submission)
  {
    m_submit_loop->Stop();
    m_submit_thread.join();
  }

  DestroyCommandBuffers();
}
Exemplo n.º 2
0
CommandBufferManager::~CommandBufferManager()
{
  // If the worker thread is enabled, wait for it to exit.
  if (m_use_threaded_submission)
  {
    // Wait for all command buffers to be consumed by the worker thread.
    m_submit_semaphore.Wait();
    m_submit_loop->Stop();
    m_submit_thread.join();
  }

  vkDeviceWaitIdle(g_vulkan_context->GetDevice());

  DestroyCommandBuffers();
}