Пример #1
0
        public static VkRenderPassCreateInfo.Raw MarshalDirect(this VkRenderPassCreateInfo s, ref byte *unmanaged)
        {
            if (s == null)
            {
                throw new InvalidOperationException("Trying to directly marshal a null.");
            }

            var pNext         = s.Next.MarshalIndirect(ref unmanaged);
            var pAttachments  = s.Attachments.MarshalDirect(ref unmanaged);
            var pSubpasses    = s.Subpasses.MarshalDirect(ref unmanaged);
            var pDependencies = s.Dependencies.MarshalDirect(ref unmanaged);

            VkRenderPassCreateInfo.Raw result;
            result.sType           = VkStructureType.RenderPassCreateInfo;
            result.pNext           = pNext;
            result.flags           = s.Flags;
            result.attachmentCount = s.Attachments?.Count ?? 0;
            result.pAttachments    = pAttachments;
            result.subpassCount    = s.Subpasses?.Count ?? 0;
            result.pSubpasses      = pSubpasses;
            result.dependencyCount = s.Dependencies?.Count ?? 0;
            result.pDependencies   = pDependencies;
            return(result);
        }
Пример #2
0
 public static int SizeOfMarshalIndirect(this VkRenderPassCreateInfo s) =>
 s == null ? 0 : s.SizeOfMarshalDirect() + VkRenderPassCreateInfo.Raw.SizeInBytes;