예제 #1
0
        protected void createCommandBuffers()
        {
            // Create one command buffer for each swap chain image and reuse for rendering
            drawCmdBuffers.Resize(Swapchain.ImageCount);
            drawCmdBuffers.Count = Swapchain.ImageCount;

            VkCommandBufferAllocateInfo cmdBufAllocateInfo =
                Initializers.CommandBufferAllocateInfo(cmdPool, VkCommandBufferLevel.Primary, drawCmdBuffers.Count);

            Util.CheckResult(vkAllocateCommandBuffers(device, ref cmdBufAllocateInfo, (VkCommandBuffer *)drawCmdBuffers.Data));
        }
예제 #2
0
        protected VkCommandBuffer createCommandBuffer(VkCommandBufferLevel level, bool begin)
        {
            VkCommandBuffer cmdBuffer;

            VkCommandBufferAllocateInfo cmdBufAllocateInfo = Initializers.CommandBufferAllocateInfo(cmdPool, level, 1);

            Util.CheckResult(vkAllocateCommandBuffers(device, &cmdBufAllocateInfo, out cmdBuffer));

            // If requested, also start the new command buffer
            if (begin)
            {
                VkCommandBufferBeginInfo cmdBufInfo = Initializers.commandBufferBeginInfo();
                Util.CheckResult(vkBeginCommandBuffer(cmdBuffer, &cmdBufInfo));
            }

            return(cmdBuffer);
        }