Ejemplo n.º 1
0
        void setupDescriptorPool()
        {
            // Example uses one ubo and one image sampler
            var poolSizes = new VkDescriptorPoolSize[2];

            poolSizes[0].type            = VkDescriptorType.UniformBuffer;
            poolSizes[0].descriptorCount = 1;
            poolSizes[1].type            = VkDescriptorType.CombinedImageSampler;
            poolSizes[1].descriptorCount = 1;

            var poolInfo = VkDescriptorPoolCreateInfo.Alloc();

            poolInfo[0].poolSizes = poolSizes;
            poolInfo[0].maxSets   = 2;
            {
                VkDescriptorPool pool;
                vkCreateDescriptorPool(device, poolInfo, null, &pool);
                descriptorPool = pool;
            }
        }
Ejemplo n.º 2
0
        void setupDescriptorPool()
        {
            // Example uses three ubos and one image sampler
            var poolSizes = new VkDescriptorPoolSize[2];

            poolSizes[0].type            = VkDescriptorType.UniformBuffer;
            poolSizes[0].descriptorCount = 4;
            poolSizes[1].type            = VkDescriptorType.CombinedImageSampler;
            poolSizes[1].descriptorCount = 6;

            var descriptorPoolInfo = VkDescriptorPoolCreateInfo.Alloc();

            descriptorPoolInfo->poolSizes = poolSizes;
            descriptorPoolInfo->maxSets   = 2;

            VkDescriptorPool pool;

            vkCreateDescriptorPool(device, descriptorPoolInfo, null, &pool);
            this.descriptorPool = pool;
            Marshal.FreeHGlobal((IntPtr)descriptorPoolInfo);
        }