Class VkImageCopy

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

    public class VkImageCopy
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Structure specifying an image copy operation.
    Description

    For IMAGE_TYPE_3D images, copies are performed slice by slice starting with the z member of the srcOffset or dstOffset, and copying depth slices. For images with multiple layers, copies are performed layer by layer starting with the baseArrayLayer member of the srcSubresource or dstSubresource and copying layerCount layers. Image data can be copied between images with different image types. If one image is IMAGE_TYPE_3D and the other image is IMAGE_TYPE_2D with multiple layers, then each slice is copied to or from a different layer.

    Copies involving a multi-planar image format specify the region to be copied in terms of the plane to be copied, not the coordinates of the multi-planar image. This means that copies accessing the R/B planes of "_422" format images must fit the copied region within half the width of the parent image, and that copies accessing the R/B planes of "_420" format images must fit the copied region within half the width and height of the parent image.

    Valid Usage
    • If neither the calling command’s srcImage nor the calling command’s dstImage has a multi-planar image format then the aspectMask member of srcSubresource and dstSubresource must match
    • If the calling command’s srcImage has a VkFormat with two planes then the srcSubresource aspectMask must be IMAGE_ASPECT_PLANE_0_BIT or IMAGE_ASPECT_PLANE_1_BIT
    • If the calling command’s srcImage has a VkFormat with three planes then the srcSubresource aspectMask must be IMAGE_ASPECT_PLANE_0_BIT, IMAGE_ASPECT_PLANE_1_BIT, or IMAGE_ASPECT_PLANE_2_BIT
    • If the calling command’s dstImage has a VkFormat with two planes then the dstSubresource aspectMask must be IMAGE_ASPECT_PLANE_0_BIT or IMAGE_ASPECT_PLANE_1_BIT
    • If the calling command’s dstImage has a VkFormat with three planes then the dstSubresource aspectMask must be IMAGE_ASPECT_PLANE_0_BIT, IMAGE_ASPECT_PLANE_1_BIT, or IMAGE_ASPECT_PLANE_2_BIT
    • If the calling command’s srcImage has a multi-planar image format and the dstImage does not have a multi-planar image format, the dstSubresource aspectMask must be IMAGE_ASPECT_COLOR_BIT
    • If the calling command’s dstImage has a multi-planar image format and the srcImage does not have a multi-planar image format, the srcSubresource aspectMask must be IMAGE_ASPECT_COLOR_BIT
    • The number of slices of the extent (for 3D) or layers of the srcSubresource (for non-3D) must match the number of slices of the extent (for 3D) or layers of the dstSubresource (for non-3D)
    • If either of the calling command’s srcImage or dstImage parameters are of VkImageType IMAGE_TYPE_3D, the baseArrayLayer and layerCount members of the corresponding subresource must be 0 and 1, respectively
    • The aspectMask member of srcSubresource must specify aspects present in the calling command’s srcImage
    • The aspectMask member of dstSubresource must specify aspects present in the calling command’s dstImage
    • srcOffset.x and (extent.width srcOffset.x) must both be greater than or equal to 0 and less than or equal to the source image subresource width
    • srcOffset.y and (extent.height srcOffset.y) must both be greater than or equal to 0 and less than or equal to the source image subresource height
    • If the calling command’s srcImage is of type IMAGE_TYPE_1D, then srcOffset.y must be 0 and extent.height must be 1.
    • srcOffset.z and (extent.depth srcOffset.z) must both be greater than or equal to 0 and less than or equal to the source image subresource depth
    • If the calling command’s srcImage is of type IMAGE_TYPE_1D, then srcOffset.z must be 0 and extent.depth must be 1.
    • If the calling command’s dstImage is of type IMAGE_TYPE_1D, then dstOffset.z must be 0 and extent.depth must be 1.
    • If the calling command’s srcImage is of type IMAGE_TYPE_2D, then srcOffset.z must be 0.
    • If the calling command’s dstImage is of type IMAGE_TYPE_2D, then dstOffset.z must be 0.
    • If both srcImage and dstImage are of type IMAGE_TYPE_2D then extent.depth must be 1.
    • If the calling command’s srcImage is of type IMAGE_TYPE_2D, and the dstImage is of type IMAGE_TYPE_3D, then extent.depth must equal to the layerCount member of srcSubresource.
    • If the calling command’s dstImage is of type IMAGE_TYPE_2D, and the srcImage is of type IMAGE_TYPE_3D, then extent.depth must equal to the layerCount member of dstSubresource.
    • dstOffset.x and (extent.width dstOffset.x) must both be greater than or equal to 0 and less than or equal to the destination image subresource width
    • dstOffset.y and (extent.height dstOffset.y) must both be greater than or equal to 0 and less than or equal to the destination image subresource height
    • If the calling command’s dstImage is of type IMAGE_TYPE_1D, then dstOffset.y must be 0 and extent.height must be 1.
    • dstOffset.z and (extent.depth dstOffset.z) must both be greater than or equal to 0 and less than or equal to the destination image subresource depth
    • If the calling command’s srcImage is a compressed image, or a single-plane, “_422” image format, all members of srcOffset must be a multiple of the corresponding dimensions of the compressed texel block
    • If the calling command’s srcImage is a compressed image, or a single-plane, “_422” image format, extent.width must be a multiple of the compressed texel block width or (extent.width + srcOffset.x) must equal the source image subresource width
    • If the calling command’s srcImage is a compressed image, or a single-plane, “_422” image format, extent.height must be a multiple of the compressed texel block height or (extent.height + srcOffset.y) must equal the source image subresource height
    • If the calling command’s srcImage is a compressed image, or a single-plane, “_422” image format, extent.depth must be a multiple of the compressed texel block depth or (extent.depth + srcOffset.z) must equal the source image subresource depth
    • If the calling command’s dstImage is a compressed format image, or a single-plane, “_422” image format, all members of dstOffset must be a multiple of the corresponding dimensions of the compressed texel block
    • If the calling command’s dstImage is a compressed format image, or a single-plane, “_422” image format, extent.width must be a multiple of the compressed texel block width or (extent.width + dstOffset.x) must equal the destination image subresource width
    • If the calling command’s dstImage is a compressed format image, or a single-plane, “_422” image format, extent.height must be a multiple of the compressed texel block height or (extent.height + dstOffset.y) must equal the destination image subresource height
    • If the calling command’s dstImage is a compressed format image, or a single-plane, “_422” image format, extent.depth must be a multiple of the compressed texel block depth or (extent.depth + dstOffset.z) must equal the destination image subresource depth
    Valid Usage (Implicit)
    See Also

    VkExtent3D, VkImageSubresourceLayers, VkOffset3D, CmdCopyImage

    Member documentation

    • srcSubresourcesrcSubresource and dstSubresource are VkImageSubresourceLayers structures specifying the image subresources of the images used for the source and destination image data, respectively.
    • srcOffsetsrcOffset and dstOffset select the initial x, y, and z offsets in texels of the sub-regions of the source and destination image data.
    • dstSubresource – see srcSubresource
    • dstOffset – see srcOffset
    • extent – the size in texels of the image to copy in width, height and depth.

    Layout

    
     struct VkImageCopy {
         VkImageSubresourceLayers srcSubresource;
         VkOffset3D srcOffset;
         VkImageSubresourceLayers dstSubresource;
         VkOffset3D dstOffset;
         VkExtent3D extent;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • SRCSUBRESOURCE, SRCOFFSET, DSTSUBRESOURCE, DSTOFFSET, EXTENT

        The struct member offsets.
    • Constructor Detail

      • VkImageCopy

        public VkImageCopy​(java.nio.ByteBuffer container)
        Creates a VkImageCopy 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
      • srcSubresource

        public VkImageCopy srcSubresource​(java.util.function.Consumer<VkImageSubresourceLayers> consumer)
        Passes the srcSubresource field to the specified Consumer.
      • srcOffset

        public VkImageCopy srcOffset​(java.util.function.Consumer<VkOffset3D> consumer)
        Passes the srcOffset field to the specified Consumer.
      • dstSubresource

        public VkImageCopy dstSubresource​(java.util.function.Consumer<VkImageSubresourceLayers> consumer)
        Passes the dstSubresource field to the specified Consumer.
      • dstOffset

        public VkImageCopy dstOffset​(java.util.function.Consumer<VkOffset3D> consumer)
        Passes the dstOffset field to the specified Consumer.
      • extent

        public VkImageCopy extent​(java.util.function.Consumer<VkExtent3D> consumer)
        Passes the extent field to the specified Consumer.
      • set

        public VkImageCopy set​(VkImageCopy src)
        Copies the specified struct data to this struct.
        Parameters:
        src - the source struct
        Returns:
        this struct
      • malloc

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

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

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

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

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

        public static VkImageCopy.Buffer malloc​(int capacity)
        Returns a new VkImageCopy.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • calloc

        public static VkImageCopy.Buffer calloc​(int capacity)
        Returns a new VkImageCopy.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • create

        public static VkImageCopy.Buffer create​(int capacity)
        Returns a new VkImageCopy.Buffer instance allocated with BufferUtils.
        Parameters:
        capacity - the buffer capacity
      • create

        public static VkImageCopy.Buffer create​(long address,
                                                int capacity)
        Create a VkImageCopy.Buffer instance at the specified memory.
        Parameters:
        address - the memory address
        capacity - the buffer capacity
      • createSafe

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

        public static VkImageCopy mallocStack()
        Returns a new VkImageCopy instance allocated on the thread-local MemoryStack.
      • callocStack

        public static VkImageCopy callocStack()
        Returns a new VkImageCopy instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

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

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

        public static VkImageCopy.Buffer mallocStack​(int capacity)
        Returns a new VkImageCopy.Buffer instance allocated on the thread-local MemoryStack.
        Parameters:
        capacity - the buffer capacity
      • callocStack

        public static VkImageCopy.Buffer callocStack​(int capacity)
        Returns a new VkImageCopy.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
        Parameters:
        capacity - the buffer capacity
      • mallocStack

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

        public static VkImageCopy.Buffer callocStack​(int capacity,
                                                     org.lwjgl.system.MemoryStack stack)
        Returns a new VkImageCopy.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
      • nsrcOffset

        public static void nsrcOffset​(long struct,
                                      VkOffset3D value)
        Unsafe version of srcOffset.
      • ndstOffset

        public static void ndstOffset​(long struct,
                                      VkOffset3D value)
        Unsafe version of dstOffset.
      • nextent

        public static void nextent​(long struct,
                                   VkExtent3D value)
        Unsafe version of extent.