/// <summary> /// Allocates a new command buffer and automatically start it. /// </summary> /// <returns>New command buffer in the recording state.</returns> /// <param name="usage">Usage.</param> public PrimaryCommandBuffer AllocateAndStart(VkCommandBufferUsageFlags usage = 0) { PrimaryCommandBuffer cmd = AllocateCommandBuffer(); cmd.Start(usage); return(cmd); }
public void BuildMipmaps(Queue copyQ, CommandPool copyCmdPool) { if (info.mipLevels == 1) { Debug.WriteLine("Invoking BuildMipmaps on image that has only one mipLevel"); return; } PrimaryCommandBuffer cmd = copyCmdPool.AllocateCommandBuffer(); cmd.Start(VkCommandBufferUsageFlags.OneTimeSubmit); BuildMipmaps(cmd); cmd.End(); copyQ.Submit(cmd); copyQ.WaitIdle(); cmd.Free(); }