Пример #1
0
 internal unsafe void MarshalTo(SharpVk.Interop.GraphicsPipelineCreateInfo *pointer)
 {
     pointer->SType = StructureType.GraphicsPipelineCreateInfo;
     pointer->Next  = null;
     if (this.Flags != null)
     {
         pointer->Flags = this.Flags.Value;
     }
     else
     {
         pointer->Flags = default(SharpVk.PipelineCreateFlags);
     }
     pointer->StageCount = (uint)(this.Stages?.Length ?? 0);
     if (this.Stages != null)
     {
         var fieldPointer = (SharpVk.Interop.PipelineShaderStageCreateInfo *)(Interop.HeapUtil.AllocateAndClear <SharpVk.Interop.PipelineShaderStageCreateInfo>(this.Stages.Length).ToPointer());
         for (int index = 0; index < (uint)(this.Stages.Length); index++)
         {
             this.Stages[index].MarshalTo(&fieldPointer[index]);
         }
         pointer->Stages = fieldPointer;
     }
     else
     {
         pointer->Stages = null;
     }
     pointer->VertexInputState = (SharpVk.Interop.PipelineVertexInputStateCreateInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.PipelineVertexInputStateCreateInfo>());
     this.VertexInputState.MarshalTo(pointer->VertexInputState);
     pointer->InputAssemblyState = (SharpVk.Interop.PipelineInputAssemblyStateCreateInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.PipelineInputAssemblyStateCreateInfo>());
     this.InputAssemblyState.MarshalTo(pointer->InputAssemblyState);
     if (this.TessellationState != null)
     {
         pointer->TessellationState = (SharpVk.Interop.PipelineTessellationStateCreateInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.PipelineTessellationStateCreateInfo>());
         this.TessellationState.Value.MarshalTo(pointer->TessellationState);
     }
     else
     {
         pointer->TessellationState = default(SharpVk.Interop.PipelineTessellationStateCreateInfo *);
     }
     if (this.ViewportState != null)
     {
         pointer->ViewportState = (SharpVk.Interop.PipelineViewportStateCreateInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.PipelineViewportStateCreateInfo>());
         this.ViewportState.Value.MarshalTo(pointer->ViewportState);
     }
     else
     {
         pointer->ViewportState = default(SharpVk.Interop.PipelineViewportStateCreateInfo *);
     }
     pointer->RasterizationState = (SharpVk.Interop.PipelineRasterizationStateCreateInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.PipelineRasterizationStateCreateInfo>());
     this.RasterizationState.MarshalTo(pointer->RasterizationState);
     if (this.MultisampleState != null)
     {
         pointer->MultisampleState = (SharpVk.Interop.PipelineMultisampleStateCreateInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.PipelineMultisampleStateCreateInfo>());
         this.MultisampleState.Value.MarshalTo(pointer->MultisampleState);
     }
     else
     {
         pointer->MultisampleState = default(SharpVk.Interop.PipelineMultisampleStateCreateInfo *);
     }
     if (this.DepthStencilState != null)
     {
         pointer->DepthStencilState = (SharpVk.Interop.PipelineDepthStencilStateCreateInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.PipelineDepthStencilStateCreateInfo>());
         this.DepthStencilState.Value.MarshalTo(pointer->DepthStencilState);
     }
     else
     {
         pointer->DepthStencilState = default(SharpVk.Interop.PipelineDepthStencilStateCreateInfo *);
     }
     if (this.ColorBlendState != null)
     {
         pointer->ColorBlendState = (SharpVk.Interop.PipelineColorBlendStateCreateInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.PipelineColorBlendStateCreateInfo>());
         this.ColorBlendState.Value.MarshalTo(pointer->ColorBlendState);
     }
     else
     {
         pointer->ColorBlendState = default(SharpVk.Interop.PipelineColorBlendStateCreateInfo *);
     }
     if (this.DynamicState != null)
     {
         pointer->DynamicState = (SharpVk.Interop.PipelineDynamicStateCreateInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.PipelineDynamicStateCreateInfo>());
         this.DynamicState.Value.MarshalTo(pointer->DynamicState);
     }
     else
     {
         pointer->DynamicState = default(SharpVk.Interop.PipelineDynamicStateCreateInfo *);
     }
     pointer->Layout             = this.Layout?.handle ?? default(SharpVk.Interop.PipelineLayout);
     pointer->RenderPass         = this.RenderPass?.handle ?? default(SharpVk.Interop.RenderPass);
     pointer->Subpass            = this.Subpass;
     pointer->BasePipelineHandle = this.BasePipelineHandle?.handle ?? default(SharpVk.Interop.Pipeline);
     pointer->BasePipelineIndex  = this.BasePipelineIndex;
 }
Пример #2
0
 public static extern SharpVk.Result vkCreateGraphicsPipelines(SharpVk.Interop.Device device, SharpVk.Interop.PipelineCache pipelineCache, uint createInfoCount, SharpVk.Interop.GraphicsPipelineCreateInfo *createInfos, SharpVk.Interop.AllocationCallbacks *allocator, SharpVk.Interop.Pipeline *pipelines);