private void CreateCommandPool()
        {
            QueueFamilyIndices queueFamilyIndices = this.FindQueueFamilies(this.physicalDevice);

            VkCommandPoolCreateInfo poolInfo = new VkCommandPoolCreateInfo()
            {
                sType            = VkStructureType.VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
                queueFamilyIndex = queueFamilyIndices.graphicsFamily.Value,
                flags            = 0, // Optional,
            };

            fixed(VkCommandPool *commandPoolPtr = &this.commandPool)
            {
                Helpers.CheckErrors(VulkanNative.vkCreateCommandPool(device, &poolInfo, null, commandPoolPtr));
            }
        }
예제 #2
0
        private void CreateCommandPool()
        {
            var indices = new QueueFamilyIndices(vkPhysicalDevice, vkSurface);

            var poolInfo = new VkCommandPoolCreateInfo()
            {
                sType            = VkStructureType.VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
                queueFamilyIndex = (uint)indices.GraphicsFamily,
                flags            = 0,
            };

            VkCommandPool newCommandPool;
            var           result = VulkanNative.vkCreateCommandPool(vkDevice, &poolInfo, null, &newCommandPool);

            vkCommandPool = newCommandPool;
            Helpers.CheckErrors(result);
        }
예제 #3
0
        public unsafe CommandPool(QueueFamily queueFamily)
        {
            _queueFamily = queueFamily;
            _device      = queueFamily.Device;
            var createInfo = new VkCommandPoolCreateInfo
            {
                sType            = VkStructureType.CommandPoolCreateInfo,
                flags            = VkCommandPoolCreateFlags.ResetCommandBuffer,
                queueFamilyIndex = queueFamily.Index
            };

            VkCommandPool commandPool;

            if (VulkanNative.vkCreateCommandPool(
                    queueFamily.Device.Handle,
                    &createInfo,
                    null,
                    &commandPool
                    ) != VkResult.Success)
            {
                throw new System.Exception("failed to create command pool on device");
            }
            _handle = commandPool;
        }