def create_framebuffers(): global framebuffers width, height = window.dimensions() framebuffers = [] for img in swapchain_image_views: framebuffer = hvk.create_framebuffer( api, device, hvk.framebuffer_create_info(render_pass=render_pass, width=width, height=height, attachments=(img, depth_view))) framebuffers.append(framebuffer)
def _setup_framebuffers(self): ctx, api, device = self.ctx render_pass = self.render_pass width, height = ctx.info["swapchain_extent"].values() if self.framebuffers is not None: for fb in self.framebuffers: hvk.destroy_framebuffer(api, device, fb) depth_view = self.depth_stencil.view framebuffers = [] for _, color_view in self.swapchain_images: framebuffer = hvk.create_framebuffer( api, device, hvk.framebuffer_create_info(render_pass=render_pass, width=width, height=height, attachments=(color_view, depth_view))) framebuffers.append(framebuffer) self.framebuffers = framebuffers