Exemple #1
0
        public static int SizeOfMarshalDirect(this VkBufferCreateInfo s)
        {
            if (s == null)
            {
                throw new InvalidOperationException("Trying to directly marshal a null.");
            }

            return
                (s.Next.SizeOfMarshalIndirect() +
                 s.QueueFamilyIndices.SizeOfMarshalDirect());
        }
Exemple #2
0
        public static VkBufferCreateInfo.Raw *MarshalIndirect(this VkBufferCreateInfo s, ref byte *unmanaged)
        {
            if (s == null)
            {
                return((VkBufferCreateInfo.Raw *) 0);
            }
            var result = (VkBufferCreateInfo.Raw *)unmanaged;

            unmanaged += VkBufferCreateInfo.Raw.SizeInBytes;
            *result = s.MarshalDirect(ref unmanaged);
            return(result);
        }
Exemple #3
0
        public static VkBufferCreateInfo.Raw MarshalDirect(this VkBufferCreateInfo s, ref byte *unmanaged)
        {
            if (s == null)
            {
                throw new InvalidOperationException("Trying to directly marshal a null.");
            }

            var pNext = s.Next.MarshalIndirect(ref unmanaged);
            var pQueueFamilyIndices = s.QueueFamilyIndices.MarshalDirect(ref unmanaged);

            VkBufferCreateInfo.Raw result;
            result.sType                 = VkStructureType.BufferCreateInfo;
            result.pNext                 = pNext;
            result.flags                 = s.Flags;
            result.size                  = s.Size;
            result.usage                 = s.Usage;
            result.sharingMode           = s.SharingMode;
            result.queueFamilyIndexCount = s.QueueFamilyIndices?.Count ?? 0;
            result.pQueueFamilyIndices   = pQueueFamilyIndices;
            return(result);
        }
Exemple #4
0
 public static int SizeOfMarshalIndirect(this VkBufferCreateInfo s) =>
 s == null ? 0 : s.SizeOfMarshalDirect() + VkBufferCreateInfo.Raw.SizeInBytes;