예제 #1
0
        private DescriptorSetLayout[] CreateDescriptorSetLayouts()
        {
            DescriptorSetLayoutBinding binding = new DescriptorSetLayoutBinding
            {
                Binding         = 0,
                DescriptorType  = DescriptorType.UniformBuffer,
                DescriptorCount = 1,
                StageFlags      = ShaderStageFlags.ShaderStageVertexBit
            };

            DescriptorSetLayoutCreateInfo createInfo = new DescriptorSetLayoutCreateInfo
            {
                SType        = StructureType.DescriptorSetLayoutCreateInfo,
                BindingCount = 1,
                PBindings    = &binding
            };

            DescriptorSetLayout layout;
            var res = VkApi.CreateDescriptorSetLayout(this.Device, &createInfo, null, &layout);

            if (res != Result.Success)
            {
                throw new VMASharp.VulkanResultException("Failed to create Descriptor Set Layout!", res);
            }

            return(new[] { layout });
        }