Class VkFramebufferCreateInfo

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer

    public class VkFramebufferCreateInfo
    extends Struct
    implements NativeResource
    Structure specifying parameters of a newly created framebuffer.

    Applications must ensure that all accesses to memory that backs image subresources used as attachments in a given renderpass instance either happen-before the load operations for those attachments, or happen-after the store operations for those attachments.

    For depth/stencil attachments, each aspect can be used separately as attachments and non-attachments as long as the non-attachment accesses are also via an image subresource in either the IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL layout or the IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL layout, and the attachment resource uses whichever of those two layouts the image accesses do not. Use of non-attachment aspects in this case is only well defined if the attachment is used in the subpass where the non-attachment access is being made, or the layout of the image subresource is constant throughout the entire render pass instance, including the initialLayout and finalLayout.


    These restrictions mean that the render pass has full knowledge of all uses of all of the attachments, so that the implementation is able to make correct decisions about when and how to perform layout transitions, when to overlap execution of subpasses, etc.

    It is legal for a subpass to use no color or depth/stencil attachments, and rather use shader side effects such as image stores and atomics to produce an output. In this case, the subpass continues to use the width, height, and layers of the framebuffer to define the dimensions of the rendering area, and the rasterizationSamples from each pipeline's VkPipelineMultisampleStateCreateInfo to define the number of samples used in rasterization; however, if VkPhysicalDeviceFeatures::variableMultisampleRate is FALSE, then all pipelines to be bound with a given zero-attachment subpass must have the same value for VkPipelineMultisampleStateCreateInfo::rasterizationSamples.

    Valid Usage
    • attachmentCount must be equal to the attachment count specified in renderPass
    • Each element of pAttachments that is used as a color attachment or resolve attachment by renderPass must have been created with a usage value including IMAGE_USAGE_COLOR_ATTACHMENT_BIT
    • Each element of pAttachments that is used as a depth/stencil attachment by renderPass must have been created with a usage value including IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
    • Each element of pAttachments that is used as an input attachment by renderPass must have been created with a usage value including IMAGE_USAGE_INPUT_ATTACHMENT_BIT
    • Each element of pAttachments must have been created with an VkFormat value that matches the VkFormat specified by the corresponding VkAttachmentDescription in renderPass
    • Each element of pAttachments must have been created with a samples value that matches the samples value specified by the corresponding VkAttachmentDescription in renderPass
    • Each element of pAttachments must have dimensions at least as large as the corresponding framebuffer dimension
    • Each element of pAttachments must only specify a single mip level
    • Each element of pAttachments must have been created with the identity swizzle
    • width must be greater than 0.
    • width must be less than or equal to VkPhysicalDeviceLimits::maxFramebufferWidth
    • height must be greater than 0.
    • height must be less than or equal to VkPhysicalDeviceLimits::maxFramebufferHeight
    • layers must be greater than 0.
    • layers must be less than or equal to VkPhysicalDeviceLimits::maxFramebufferLayers
    • Each element of pAttachments that is a 2D or 2D array image view taken from a 3D image must not be a depth/stencil format
    Valid Usage (Implicit)
    • pNext must be NULL
    • flags must be 0
    • renderPass must be a valid VkRenderPass handle
    • If attachmentCount is not 0, pAttachments must be a valid pointer to an array of attachmentCount valid VkImageView handles
    • Both of renderPass, and the elements of pAttachments that are valid handles must have been created, allocated, or retrieved from the same VkDevice
    See Also


    Member documentation

    • sType – the type of this structure.
    • pNextNULL or a pointer to an extension-specific structure.
    • flags – reserved for future use.
    • renderPass – a render pass that defines what render passes the framebuffer will be compatible with. See Render Pass Compatibility for details.
    • attachmentCount – the number of attachments.
    • pAttachments – an array of VkImageView handles, each of which will be used as the corresponding attachment in a render pass instance.
    • widthwidth, height and layers define the dimensions of the framebuffer. If the render pass uses multiview, then layers must be one and each attachment requires a number of layers that is greater than the maximum bit index set in the view mask in the subpasses in which it is used.
    • height – see width
    • layers – see width


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

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.

        The struct member offsets.
    • Constructor Detail

      • VkFramebufferCreateInfo

        public VkFramebufferCreateInfo​(java.nio.ByteBuffer container)
        Creates a VkFramebufferCreateInfo instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.

    • Method Detail

      • sizeof

        public int sizeof()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • sType

        public int sType()
        Returns the value of the sType field.
      • pNext

        public long pNext()
        Returns the value of the pNext field.
      • flags

        public int flags()
        Returns the value of the flags field.
      • renderPass

        public long renderPass()
        Returns the value of the renderPass field.
      • attachmentCount

        public int attachmentCount()
        Returns the value of the attachmentCount field.
      • pAttachments

        public java.nio.LongBuffer pAttachments()
        Returns a LongBuffer view of the data pointed to by the pAttachments field.
      • width

        public int width()
        Returns the value of the width field.
      • height

        public int height()
        Returns the value of the height field.
      • layers

        public int layers()
        Returns the value of the layers field.
      • renderPass

        public VkFramebufferCreateInfo renderPass​(long value)
        Sets the specified value to the renderPass field.
      • pAttachments

        public VkFramebufferCreateInfo pAttachments​(@Nullable
                                                    java.nio.LongBuffer value)
        Sets the address of the specified LongBuffer to the pAttachments field.
      • set

        public VkFramebufferCreateInfo set​(int sType,
                                           long pNext,
                                           int flags,
                                           long renderPass,
                                           java.nio.LongBuffer pAttachments,
                                           int width,
                                           int height,
                                           int layers)
        Initializes this struct with the specified values.
      • nsType

        public static int nsType​(long struct)
        Unsafe version of sType().
      • npNext

        public static long npNext​(long struct)
        Unsafe version of pNext().
      • nflags

        public static int nflags​(long struct)
        Unsafe version of flags().
      • nrenderPass

        public static long nrenderPass​(long struct)
        Unsafe version of renderPass().
      • nattachmentCount

        public static int nattachmentCount​(long struct)
        Unsafe version of attachmentCount().
      • npAttachments

        public static java.nio.LongBuffer npAttachments​(long struct)
        Unsafe version of pAttachments.
      • nwidth

        public static int nwidth​(long struct)
        Unsafe version of width().
      • nheight

        public static int nheight​(long struct)
        Unsafe version of height().
      • nlayers

        public static int nlayers​(long struct)
        Unsafe version of layers().
      • nsType

        public static void nsType​(long struct,
                                  int value)
        Unsafe version of sType.
      • npNext

        public static void npNext​(long struct,
                                  long value)
        Unsafe version of pNext.
      • nflags

        public static void nflags​(long struct,
                                  int value)
        Unsafe version of flags.
      • nrenderPass

        public static void nrenderPass​(long struct,
                                       long value)
        Unsafe version of renderPass.
      • nattachmentCount

        public static void nattachmentCount​(long struct,
                                            int value)
        Sets the specified value to the attachmentCount field of the specified struct.
      • npAttachments

        public static void npAttachments​(long struct,
                                         java.nio.LongBuffer value)
        Unsafe version of pAttachments.
      • nwidth

        public static void nwidth​(long struct,
                                  int value)
        Unsafe version of width.
      • nheight

        public static void nheight​(long struct,
                                   int value)
        Unsafe version of height.
      • nlayers

        public static void nlayers​(long struct,
                                   int value)
        Unsafe version of layers.
      • validate

        public static void validate​(long struct)
        Validates pointer members that should not be NULL.
        struct - the struct to validate
      • validate

        public static void validate​(long array,
                                    int count)
        Calls validate(long) for each struct contained in the specified struct array.
        array - the struct array to validate
        count - the number of structs in array