public RenderPass(FrameBuffer myFrameBuffer, SubPass[] mySubpasses = null) { List <AttachmentDescription> GBufferSupportedTypes = new List <AttachmentDescription>(); List <AttachmentReference> attachmentColorReferences = new List <AttachmentReference>(); AttachmentReference myDepthBuffer; SubpassDescription GeometryBufferSubpassDescription = new SubpassDescription() { PipelineBindPoint = PipelineBindPoint.Graphics }; foreach (var Attachment in myFrameBuffer.GetAttachments()) { GBufferSupportedTypes.Add(Attachment.AttachmentDescription); if (Attachment.AttachmentReference.Layout != ImageLayout.DepthStencilAttachmentOptimal) { attachmentColorReferences.Add(Attachment.AttachmentReference); } else { GeometryBufferSubpassDescription.DepthStencilAttachment = Attachment.AttachmentReference; } } GeometryBufferSubpassDescription.ColorAttachments = attachmentColorReferences.ToArray(); //Above is for the Geometry Buffer to intialize. uint starting = 1; uint ending = 2; List <SubpassDependency> myIncomingDependencies = new List <SubpassDependency>(); List <SubpassDescription> mySubpassDescriptions = new List <SubpassDescription>(); if (mySubpasses != null) { for (int i = 0; i < mySubpasses.Length; i++) { myIncomingDependencies.AddRange(mySubpasses[i].GetSubpassDependencies()); mySubpassDescriptions.Add(mySubpasses[i].GetSubpassDescription()); } ; } var aRenderPassCreateInfo = new RenderPassCreateInfo { Attachments = GBufferSupportedTypes.ToArray(), Subpasses = mySubpassDescriptions.ToArray(), Dependencies = myIncomingDependencies.ToArray() }; myFrameBuffer.SetRenderPass(this); CreateRenderPass(aRenderPassCreateInfo); }