public VkFrameBuffer(VkDevice device, int width, int height, int layers, LongBuffer pAttachments, long renderPass) { this.device = device; VkFramebufferCreateInfo framebufferInfo = VkFramebufferCreateInfo.calloc() .sType(VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO) .pAttachments(pAttachments) .flags(0) .height(height) .width(width) .layers(layers) .pNext(0) .renderPass(renderPass); LongBuffer pFramebuffer = memAllocLong(1); int err = vkCreateFramebuffer(device, framebufferInfo, null, pFramebuffer); if (err != VK_SUCCESS) { throw new AssertionError("Failed to create framebuffer: " + VkUtil.translateVulkanResult(err)); } handle = pFramebuffer.get(0); framebufferInfo.free(); memFree(pFramebuffer); memFree(pAttachments); }
flags(flags); renderPass(renderPass); pAttachments(pAttachments); width(width); height(height);