Class VkBufferImageCopy

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

    public class VkBufferImageCopy
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Structure specifying a buffer image copy operation.
    Description

    When copying to or from a depth or stencil aspect, the data in buffer memory uses a layout that is a (mostly) tightly packed representation of the depth or stencil data. Specifically:

    Note

    To copy both the depth and stencil aspects of a depth/stencil format, two entries in pRegions can be used, where one specifies the depth aspect in imageSubresource, and the other specifies the stencil aspect.

    Because depth or stencil aspect buffer to image copies may require format conversions on some implementations, they are not supported on queues that do not support graphics.

    When copying to a depth aspect, and the VK_EXT_depth_range_unrestricted extension is not enabled, the data in buffer memory must be in the range [0,1], or the resulting values are undefined.

    Copies are done layer by layer starting with image layer baseArrayLayer member of imageSubresource. layerCount layers are copied from the source image or to the destination image.

    For purpose of valid usage statements here and in related copy commands, a blocked image is defined as:

    • an image with a single-plane, “_422” format, which is treated as a format with a 2 × 1 compressed texel block, or
    • a compressed image.
    Valid Usage
    • bufferRowLength must be 0, or greater than or equal to the width member of imageExtent
    • bufferImageHeight must be 0, or greater than or equal to the height member of imageExtent
    • The aspectMask member of imageSubresource must only have a single bit set
    Valid Usage (Implicit)
    See Also

    VkExtent3D, VkImageSubresourceLayers, VkOffset3D, CmdCopyBufferToImage, CmdCopyImageToBuffer

    Layout

    
     struct VkBufferImageCopy {
         VkDeviceSize bufferOffset();
         uint32_t bufferRowLength();
         uint32_t bufferImageHeight();
         VkImageSubresourceLayers imageSubresource();
         VkOffset3D imageOffset();
         VkExtent3D imageExtent();
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • BUFFEROFFSET, BUFFERROWLENGTH, BUFFERIMAGEHEIGHT, IMAGESUBRESOURCE, IMAGEOFFSET, IMAGEEXTENT

        The struct member offsets.
    • Constructor Detail

      • VkBufferImageCopy

        public VkBufferImageCopy​(java.nio.ByteBuffer container)
        Creates a VkBufferImageCopy 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()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • bufferOffset

        public long bufferOffset()
        the offset in bytes from the start of the buffer object where the image data is copied from or to.
      • bufferRowLength

        public int bufferRowLength()
        bufferRowLength and bufferImageHeight specify in texels a subregion of a larger two- or three-dimensional image in buffer memory, and control the addressing calculations. If either of these values is zero, that aspect of the buffer memory is considered to be tightly packed according to the imageExtent.
      • bufferImageHeight

        public int bufferImageHeight()
        see bufferRowLength
      • imageOffset

        public VkOffset3D imageOffset()
        selects the initial x, y, z offsets in texels of the sub-region of the source or destination image data.
      • imageExtent

        public VkExtent3D imageExtent()
        the size in texels of the image to copy in width, height and depth.
      • malloc

        public static VkBufferImageCopy malloc()
        Returns a new VkBufferImageCopy instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static VkBufferImageCopy calloc()
        Returns a new VkBufferImageCopy instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static VkBufferImageCopy create()
        Returns a new VkBufferImageCopy instance allocated with BufferUtils.
      • create

        public static VkBufferImageCopy create​(long address)
        Returns a new VkBufferImageCopy instance for the specified memory address.
      • createSafe

        @Nullable
        public static VkBufferImageCopy createSafe​(long address)
        Like create, but returns null if address is NULL.
      • createSafe

        @Nullable
        public static VkBufferImageCopy.Buffer createSafe​(long address,
                                                          int capacity)
        Like create, but returns null if address is NULL.
      • mallocStack

        @Deprecated
        public static VkBufferImageCopy mallocStack​(org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
      • callocStack

        @Deprecated
        public static VkBufferImageCopy callocStack​(org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
      • malloc

        public static VkBufferImageCopy malloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new VkBufferImageCopy instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • calloc

        public static VkBufferImageCopy calloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new VkBufferImageCopy instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • malloc

        public static VkBufferImageCopy.Buffer malloc​(int capacity,
                                                      org.lwjgl.system.MemoryStack stack)
        Returns a new VkBufferImageCopy.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • calloc

        public static VkBufferImageCopy.Buffer calloc​(int capacity,
                                                      org.lwjgl.system.MemoryStack stack)
        Returns a new VkBufferImageCopy.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • nbufferOffset

        public static long nbufferOffset​(long struct)
        Unsafe version of bufferOffset().
      • nbufferRowLength

        public static int nbufferRowLength​(long struct)
        Unsafe version of bufferRowLength().
      • nbufferImageHeight

        public static int nbufferImageHeight​(long struct)
        Unsafe version of bufferImageHeight().
      • nbufferOffset

        public static void nbufferOffset​(long struct,
                                         long value)
        Unsafe version of bufferOffset.
      • nbufferRowLength

        public static void nbufferRowLength​(long struct,
                                            int value)
        Unsafe version of bufferRowLength.
      • nbufferImageHeight

        public static void nbufferImageHeight​(long struct,
                                              int value)
        Unsafe version of bufferImageHeight.
      • nimageOffset

        public static void nimageOffset​(long struct,
                                        VkOffset3D value)
        Unsafe version of imageOffset.
      • nimageExtent

        public static void nimageExtent​(long struct,
                                        VkExtent3D value)
        Unsafe version of imageExtent.