Example #1
0
        private void createGraphicsCommandPool()
        {
            var poolInfo = new Vk.CommandPoolCreateInfo();

            poolInfo.QueueFamilyIndex = this.vkQueueFamilies.GraphicsFamily.Value;

            try {
                this.GraphicsCommandPool = this.Device.CreateCommandPool(poolInfo);
            } catch (Vk.ResultException result) {
                throw new VkException("An error occurred while creating the graphics command pool.", result);
            }
        }
Example #2
0
        public void EndSingleTimeCommands(Vk.Queue queue,
                                          Vk.CommandPool commandPool, Vk.CommandBuffer buffer)
        {
            buffer.End();

            var submitInfo = new Vk.SubmitInfo();

            submitInfo.CommandBufferCount = 1;
            submitInfo.CommandBuffers     = new Vk.CommandBuffer[] { buffer };

            queue.Submit(new Vk.SubmitInfo[] { submitInfo });
            queue.WaitIdle();
            this.Device.FreeCommandBuffer(commandPool, buffer);
        }
Example #3
0
        public Vk.CommandBuffer BeginSingleTimeCommands(Vk.CommandPool commandPool)
        {
            var allocInfo = new Vk.CommandBufferAllocateInfo();

            allocInfo.Level              = Vk.CommandBufferLevel.Primary;
            allocInfo.CommandPool        = commandPool;
            allocInfo.CommandBufferCount = 1;

            var buffer = this.Device.AllocateCommandBuffers(allocInfo)[0];

            var beginInfo = new Vk.CommandBufferBeginInfo();

            beginInfo.Flags = Vk.CommandBufferUsageFlags.OneTimeSubmit;

            buffer.Begin(beginInfo);
            return(buffer);
        }