public void Begin(VkCommandBufferUsageFlags flags, ref CommandBufferInheritanceInfo commandBufferInheritanceInfo) { unsafe { var cmdBufBeginInfo = new VkCommandBufferBeginInfo { sType = VkStructureType.CommandBufferBeginInfo, flags = flags, pInheritanceInfo = (VkCommandBufferInheritanceInfo *)Unsafe.AsPointer(ref commandBufferInheritanceInfo.native) }; VulkanUtil.CheckResult(vkBeginCommandBuffer(commandBuffer, &cmdBufBeginInfo)); } opened = true; ClearDescriptorSets(); }
public CommandBuffer GetCmdBuffer(int index) { int workContext = Graphics.WorkContext; var cb = cmdBufferPools[index][workContext].Get(); if (!cb.IsOpen) { var inherit = new CommandBufferInheritanceInfo ( FrameGraphPass.Framebuffers[Graphics.WorkImage], FrameGraphPass.RenderPass, SubpassIndex ); cb.Begin(VkCommandBufferUsageFlags.OneTimeSubmit | VkCommandBufferUsageFlags.RenderPassContinue | VkCommandBufferUsageFlags.SimultaneousUse, ref inherit); } return(cb); }