public override void Dispose() { if (framebuffer != SharpVulkan.Framebuffer.Null) { Context.Release(framebuffer); Context.Release(renderPass); Context.Release(depthStencilView); Context.Release(depthStencilBuffer); Context.Release(depthStencilMemory); framebuffer = SharpVulkan.Framebuffer.Null; } base.Dispose(); }
private void CreateFramebuffer() { var attachments = new[] { ImageView, depthStencilView }; fixed(SharpVulkan.ImageView *attachmentsPtr = attachments) { var createInfo = new SharpVulkan.FramebufferCreateInfo { StructureType = SharpVulkan.StructureType.FramebufferCreateInfo, AttachmentCount = (uint)attachments.Length, Attachments = new IntPtr(attachmentsPtr), Width = (uint)Width, Height = (uint)Height, Layers = 1, RenderPass = renderPass }; framebuffer = Context.Device.CreateFramebuffer(ref createInfo); } }