예제 #1
0
        public CommandPool(Device device, CommandPoolCreateInfo info)
        {
            if (device == null)
            {
                throw new ArgumentNullException(nameof(device));
            }
            if (info == null)
            {
                throw new ArgumentNullException(nameof(info));
            }

            Device = device;

            CreateCommandPool(info);
        }
예제 #2
0
        void CreateCommandPool(CommandPoolCreateInfo mInfo)
        {
            VkCommandPoolCreateInfo info = new VkCommandPoolCreateInfo();

            info.sType            = VkStructureType.CommandPoolCreateInfo;
            info.flags            = mInfo.flags;
            info.queueFamilyIndex = mInfo.queueFamilyIndex;

            var result = Device.Commands.createCommandPool(Device.Native, ref info, Device.Instance.AllocationCallbacks, out commandPool);

            if (result != VkResult.Success)
            {
                throw new CommandPoolException(string.Format("Error creating command pool: {0}", result));
            }

            Flags = mInfo.flags;
        }