| 81 | } |
| 82 | |
| 83 | TrackedCommandBufferPtr Queue::getOrCreateCommandBuffer() |
| 84 | { |
| 85 | std::lock_guard lockGuard(m_Mutex); // this is called from CommandList::open, so free-threaded |
| 86 | |
| 87 | uint64_t recordingID = ++m_LastRecordingID; |
| 88 | |
| 89 | TrackedCommandBufferPtr cmdBuf; |
| 90 | if (m_CommandBuffersPool.empty()) |
| 91 | { |
| 92 | cmdBuf = createCommandBuffer(); |
| 93 | } |
| 94 | else |
| 95 | { |
| 96 | cmdBuf = m_CommandBuffersPool.front(); |
| 97 | m_CommandBuffersPool.pop_front(); |
| 98 | } |
| 99 | |
| 100 | cmdBuf->recordingID = recordingID; |
| 101 | return cmdBuf; |
| 102 | } |
| 103 | |
| 104 | void Queue::addWaitSemaphore(vk::Semaphore semaphore, uint64_t value) |
| 105 | { |