Пример #1
0
        public void Write(string name, DescriptorImageInfo myInfo)
        {
            var Value = myIDsToItems[name];

            WriteDescriptorSet mySet = new WriteDescriptorSet();

            mySet.DescriptorType  = DescriptorType.UniformBuffer;
            mySet.DescriptorCount = Value.DescriptorCount;
            mySet.DstBinding      = Value.Binding;
            mySet.DstSet          = myDSet[Value.Binding];
            unsafe
            {
                mySet.ImageInfo = new DescriptorImageInfo[] { myInfo };
            }
            VulkanRenderer.SelectedLogicalDevice.UpdateDescriptorSet(mySet, null);
            mySet.Dispose();
        }
Пример #2
0
        internal void Write <T>(string v, T mYBuffer) where T : struct
        {
            var Value                = myIDsToItems[v];
            var MVPBuffer            = new UniformBuffer <T>(mYBuffer);
            WriteDescriptorSet mySet = new WriteDescriptorSet();

            mySet.DescriptorType  = DescriptorType.UniformBuffer;
            mySet.DescriptorCount = Value.DescriptorCount;
            mySet.DstBinding      = Value.Binding;
            mySet.DstSet          = myDSet[Value.Binding];
            unsafe
            {
                mySet.BufferInfo = new DescriptorBufferInfo[] { new DescriptorBufferInfo {
                                                                    Buffer = MVPBuffer, Offset = 0, Range = MVPBuffer.SizeOfBuffer
                                                                } };
            }
            VulkanRenderer.SelectedLogicalDevice.UpdateDescriptorSet(mySet, null);
            MVPBuffer.Dispose();
            mySet.Dispose();
        }