Exemplo n.º 1
0
        internal unsafe void MarshalTo(Interop.RenderPassCreateInfo *pointer)
        {
            pointer->SType = StructureType.RenderPassCreateInfo;
            pointer->Next  = null;

            //Attachments
            if (this.Attachments != null)
            {
                pointer->Attachments = (AttachmentDescription *)Interop.HeapUtil.Allocate <AttachmentDescription>(this.Attachments.Length).ToPointer();
                for (int index = 0; index < this.Attachments.Length; index++)
                {
                    pointer->Attachments[index] = this.Attachments[index];
                }
            }
            else
            {
                pointer->Attachments = null;
            }

            //Subpasses
            if (this.Subpasses != null)
            {
                var fieldPointer = (Interop.SubpassDescription *)Interop.HeapUtil.AllocateAndClear <Interop.SubpassDescription>(this.Subpasses.Length);
                for (int index = 0; index < this.Subpasses.Length; index++)
                {
                    this.Subpasses[index].MarshalTo(&fieldPointer[index]);
                }
                pointer->Subpasses = fieldPointer;
            }
            else
            {
                pointer->Subpasses = null;
            }

            //Dependencies
            if (this.Dependencies != null)
            {
                pointer->Dependencies = (SubpassDependency *)Interop.HeapUtil.Allocate <SubpassDependency>(this.Dependencies.Length).ToPointer();
                for (int index = 0; index < this.Dependencies.Length; index++)
                {
                    pointer->Dependencies[index] = this.Dependencies[index];
                }
            }
            else
            {
                pointer->Dependencies = null;
            }
            pointer->AttachmentCount = (uint)(this.Attachments?.Length ?? 0);
            pointer->SubpassCount    = (uint)(this.Subpasses?.Length ?? 0);
            pointer->DependencyCount = (uint)(this.Dependencies?.Length ?? 0);
            pointer->Flags           = this.Flags;
        }
Exemplo n.º 2
0
 internal RenderPassCreateInfo(Interop.RenderPassCreateInfo* ptr)
 {
     m = ptr;
     Initialize ();
 }
Exemplo n.º 3
0
 public RenderPassCreateInfo()
 {
     m = (Interop.RenderPassCreateInfo*) Interop.Structure.Allocate (typeof (Interop.RenderPassCreateInfo));
     Initialize ();
 }