Exemplo n.º 1
0
        public static VkWriteDescriptorSet.Raw MarshalDirect(this VkWriteDescriptorSet s, ref byte *unmanaged)
        {
            if (s == null)
            {
                throw new InvalidOperationException("Trying to directly marshal a null.");
            }

            var pNext            = s.Next.MarshalIndirect(ref unmanaged);
            var pImageInfo       = s.ImageInfo.MarshalDirect(ref unmanaged);
            var pBufferInfo      = s.BufferInfo.MarshalDirect(ref unmanaged);
            var pTexelBufferView = s.TexelBufferView.MarshalDirect(ref unmanaged);

            VkWriteDescriptorSet.Raw result;
            result.sType            = VkStructureType.WriteDescriptorSet;
            result.pNext            = pNext;
            result.dstSet           = s.DstSet?.Handle ?? VkDescriptorSet.HandleType.Null;
            result.dstBinding       = s.DstBinding;
            result.dstArrayElement  = s.DstArrayElement;
            result.descriptorCount  = s.DescriptorCount;
            result.descriptorType   = s.DescriptorType;
            result.pImageInfo       = pImageInfo;
            result.pBufferInfo      = pBufferInfo;
            result.pTexelBufferView = pTexelBufferView;
            return(result);
        }
Exemplo n.º 2
0
        public static VkWriteDescriptorSet.Raw *MarshalIndirect(this VkWriteDescriptorSet s, ref byte *unmanaged)
        {
            if (s == null)
            {
                return((VkWriteDescriptorSet.Raw *) 0);
            }
            var result = (VkWriteDescriptorSet.Raw *)unmanaged;

            unmanaged += VkWriteDescriptorSet.Raw.SizeInBytes;
            *result = s.MarshalDirect(ref unmanaged);
            return(result);
        }
Exemplo n.º 3
0
        public static int SizeOfMarshalDirect(this VkWriteDescriptorSet s)
        {
            if (s == null)
            {
                throw new InvalidOperationException("Trying to directly marshal a null.");
            }

            return
                (s.Next.SizeOfMarshalIndirect() +
                 s.ImageInfo.SizeOfMarshalDirect() +
                 s.BufferInfo.SizeOfMarshalDirect() +
                 s.TexelBufferView.SizeOfMarshalDirect());
        }
Exemplo n.º 4
0
 public static int SizeOfMarshalIndirect(this VkWriteDescriptorSet s) =>
 s == null ? 0 : s.SizeOfMarshalDirect() + VkWriteDescriptorSet.Raw.SizeInBytes;