-
Notifications
You must be signed in to change notification settings - Fork 0
/
framebuffer.py
30 lines (22 loc) · 883 Bytes
/
framebuffer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from config import *
class framebufferInput:
def __init__(self):
self.device = None
self.renderpass = None
self.swapchainExtent = None
def make_framebuffers(inputChunk: framebufferInput, frames, debug):
for i, frame in enumerate(frames):
attachments = [frame.image_view]
framebufferInfo = VkFramebufferCreateInfo(
renderPass=inputChunk.renderpass,
attachmentCount=1,
pAttachments=attachments,
width=inputChunk.swapchainExtent.width,
height=inputChunk.swapchainExtent.height,
layers = 1
)
try:
frame.frameBuffer = vkCreateFramebuffer(inputChunk.device, framebufferInfo, None)
if debug: print(f"Made framebuffer for frame {i}")
except:
if debug: print(f"Failed to make framebuffer for frame {i}")