internal static OutputDescription CreateFromFramebuffer(Framebuffer fb) { TextureSampleCount sampleCount = 0; OutputAttachmentDescription?depthAttachment = null; if (fb.DepthTarget != null) { depthAttachment = new OutputAttachmentDescription(fb.DepthTarget.Value.Target.Format); sampleCount = fb.DepthTarget.Value.Target.SampleCount; } OutputAttachmentDescription[] colorAttachments = new OutputAttachmentDescription[fb.ColorTargets.Count]; for (int i = 0; i < colorAttachments.Length; i++) { colorAttachments[i] = new OutputAttachmentDescription(fb.ColorTargets[i].Target.Format); sampleCount = fb.ColorTargets[i].Target.SampleCount; } return(new OutputDescription(depthAttachment, colorAttachments, sampleCount)); }