| 305 | } |
| 306 | |
| 307 | void VulkanObjectManager::CollectObjects(uint32_t inflightFrameIndex) |
| 308 | { |
| 309 | auto const currentThreadId = std::this_thread::get_id(); |
| 310 | if (currentThreadId == m_renderers[ThreadType::Frontend]) |
| 311 | { |
| 312 | CollectObjectsForThread(m_queuesToDestroy[ThreadType::Frontend][inflightFrameIndex]); |
| 313 | } |
| 314 | else if (currentThreadId == m_renderers[ThreadType::Backend]) |
| 315 | { |
| 316 | CollectObjectsForThread(m_queuesToDestroy[ThreadType::Backend][kBackendQueueIndex]); |
| 317 | |
| 318 | std::lock_guard<std::mutex> lock(m_destroyMutex); |
| 319 | CollectObjectsForThread(m_queuesToDestroy[ThreadType::Other][kOtherQueueIndex]); |
| 320 | } |
| 321 | } |
| 322 | |
| 323 | void VulkanObjectManager::CollectObjectsForThread(VulkanObjectArray & objects) |
| 324 | { |