MCPcopy Create free account
hub / github.com/NVIDIA-RTX/NVRHI / getOrCreateCommandBuffer

Method getOrCreateCommandBuffer

src/vulkan/vulkan-queue.cpp:83–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 1

openMethod · 0.80

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected