MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / FlushCommandBuffer

Method FlushCommandBuffer

deps/LLGL/sources/Renderer/Vulkan/VKDevice.cpp:157–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157void VKDevice::FlushCommandBuffer(VkCommandBuffer cmdBuffer, bool release)
158{
159 /* End command buffer record */
160 auto result = vkEndCommandBuffer(cmdBuffer);
161 VKThrowIfFailed(result, "failed to end recording Vulkan command buffer");
162
163 /* Create fence to ensure the command buffer has finished execution */
164 {
165 VKFence fence{ device_ };
166
167 /* Submit command buffer to queue */
168 VkSubmitInfo submitInfo = {};
169 {
170 submitInfo.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
171 submitInfo.commandBufferCount = 1;
172 submitInfo.pCommandBuffers = (&cmdBuffer);
173 }
174 vkQueueSubmit(graphicsQueue_, 1, &submitInfo, fence.GetVkFence());
175
176 /* Wait for fence to be signaled */
177 fence.Wait(device_, std::numeric_limits<std::uint64_t>::max());
178 }
179
180 /* Release command buffer (if enabled) */
181 if (release)
182 vkFreeCommandBuffers(device_, commandPool_, 1, &cmdBuffer);
183}
184
185void VKDevice::TransitionImageLayout(
186 VkCommandBuffer commandBuffer,

Callers 3

CreateTextureMethod · 0.80
WriteTextureMethod · 0.80
ReadTextureMethod · 0.80

Calls 3

VKThrowIfFailedFunction · 0.85
GetVkFenceMethod · 0.80
WaitMethod · 0.45

Tested by

no test coverage detected