VKCREATEFRAMEBUFFER(3)

NAME
vkCreateFramebuffer - Create a new framebuffer object.

C SPECIFICATION

    VkResult vkCreateFramebuffer(
        VkDevice                                    device,
        const VkFramebufferCreateInfo*              pCreateInfo,
        const VkAllocationCallbacks*                pAllocator,
        VkFramebuffer*                              pFramebuffer);

PARAMETERS

device
    The device with which to create the framebuffer object.

pCreateInfo
    A pointer to a structure containing information about how to create the object.

pFramebuffer
    A pointer to a variable which will receive the handle to the new object.

DESCRIPTION

vkCreateFramebuffer creates a new framebuffer object using the information contained in pCreateInfo and the device specified in device. Upon success, a handle to the new framebuffer object is deposited in the variable pointed to by pFramebuffer. pCreateInfo should point to an instance of the VkFramebufferCreateInfo structure, the definition of which is:

    typedef struct VkFramebufferCreateInfo {
        VkStructureType             sType;
        const void*                 pNext;
        VkFramebufferCreateFlags    flags;
        VkRenderPass                renderPass;
        uint32_t                    attachmentCount;
        const VkImageView*          pAttachments;
        uint32_t                    width;
        uint32_t                    height;
        uint32_t                    layers;
    } VkFramebufferCreateInfo;

The attachments in pAttachments correspond in order to the attachment descriptions in the renderPass. The attachment view must have the same format, sample count, and initial layout as the render pass’s attachment description. All attachment views must also have dimensions at least as large as the framebuffer’s width, height, and layers.

The framebuffer may be used in combination with any render pass that has the same attachment count, and corresponding attachments have the same format and sample count.

VALID USAGE

    • device must be a valid VkDevice handle

    • pCreateInfo must be a pointer to a valid VkFramebufferCreateInfo structure

    • If pAllocator is not NULL, pAllocator must be a pointer to a valid VkAllocationCallbacks structure

    • pFramebuffer must be a pointer to a VkFramebuffer handle

RETURN CODES

On success, this command returns

        • VK_SUCCESS

On failure, this command returns

        • VK_ERROR_OUT_OF_HOST_MEMORY

        • VK_ERROR_OUT_OF_DEVICE_MEMORY

SEE ALSO

vkCmdBeginRenderPass, vkDestroyFramebuffer

COPYRIGHT

Copyright © 2014-2016 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.

AUTHOR

Khronos Group
    Author.