Class VkCopyBufferToImageInfo2

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer
    Direct Known Subclasses:
    VkCopyBufferToImageInfo2KHR

    public class VkCopyBufferToImageInfo2
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Structure specifying parameters of a buffer to image copy command.
    Valid Usage
    • srcBuffer must be large enough to contain all buffer locations that are accessed according to Buffer and Image Addressing, for each element of pRegions
    • The union of all source regions, and the union of all destination regions, specified by the elements of pRegions, must not overlap in memory
    • srcBuffer must have been created with BUFFER_USAGE_TRANSFER_SRC_BIT usage flag
    • The format features of dstImage must contain FORMAT_FEATURE_TRANSFER_DST_BIT
    • If srcBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object
    • dstImage must have been created with IMAGE_USAGE_TRANSFER_DST_BIT usage flag
    • If dstImage is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object
    • dstImage must have a sample count equal to SAMPLE_COUNT_1_BIT
    • dstImageLayout must specify the layout of the image subresources of dstImage specified in pRegions at the time this command is executed on a VkDevice
    • dstImageLayout must be IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, IMAGE_LAYOUT_GENERAL, or IMAGE_LAYOUT_SHARED_PRESENT_KHR
    • The imageSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when dstImage was created
    • The imageSubresource.baseArrayLayer + imageSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when dstImage was created
    • The imageOffset and imageExtent members of each element of pRegions must respect the image transfer granularity requirements of commandBuffer’s command pool’s queue family, as described in VkQueueFamilyProperties
    • dstImage must not have been created with flags containing IMAGE_CREATE_SUBSAMPLED_BIT_EXT
    • If the queue family used to create the VkCommandPool which commandBuffer was allocated from does not support QUEUE_GRAPHICS_BIT, for each element of pRegions, the aspectMask member of imageSubresource must not be IMAGE_ASPECT_DEPTH_BIT or IMAGE_ASPECT_STENCIL_BIT
    • For each element of pRegions not containing VkCopyCommandTransformInfoQCOM in its pNext chain, imageOffset.x and (imageExtent.width + imageOffset.x) must both be greater than or equal to 0 and less than or equal to the width of the specified imageSubresource of dstImage
    • For each element of pRegions not containing VkCopyCommandTransformInfoQCOM in its pNext chain, imageOffset.y and (imageExtent.height + imageOffset.y) must both be greater than or equal to 0 and less than or equal to the height of the specified imageSubresource of dstImage
    • If srcImage does not have either a depth/stencil or a multi-planar format, then for each element of pRegions, bufferOffset must be a multiple of the format’s texel block size
    • If srcImage has a multi-planar format, then for each element of pRegions, bufferOffset must be a multiple of the element size of the compatible format for the format and the aspectMask of the imageSubresource as defined in Compatible formats of planes of multi-planar formats
    • If srcImage is of type IMAGE_TYPE_1D, then for each element of pRegions, imageOffset.y must be 0 and imageExtent.height must be 1
    • For each element of pRegions, imageOffset.z and (imageExtent.depth + imageOffset.z) must both be greater than or equal to 0 and less than or equal to the depth of the specified imageSubresource of srcImage
    • If srcImage is of type IMAGE_TYPE_1D or IMAGE_TYPE_2D, then for each element of pRegions, imageOffset.z must be 0 and imageExtent.depth must be 1
    • If srcImage is a blocked image, for each element of pRegions, bufferRowLength must be a multiple of the compressed texel block width
    • If srcImage is a blocked image, for each element of pRegions, bufferImageHeight must be a multiple of the compressed texel block height
    • If srcImage is a blocked image, for each element of pRegions, all members of imageOffset must be a multiple of the corresponding dimensions of the compressed texel block
    • If srcImage is a blocked image, for each element of pRegions, bufferOffset must be a multiple of the compressed texel block size in bytes
    • If srcImage is a blocked image, for each element of pRegions, imageExtent.width must be a multiple of the compressed texel block width or (imageExtent.width + imageOffset.x) must equal the width of the specified imageSubresource of srcImage
    • If srcImage is a blocked image, for each element of pRegions, imageExtent.height must be a multiple of the compressed texel block height or (imageExtent.height + imageOffset.y) must equal the height of the specified imageSubresource of srcImage
    • If srcImage is a blocked image, for each element of pRegions, imageExtent.depth must be a multiple of the compressed texel block depth or (imageExtent.depth + imageOffset.z) must equal the depth of the specified imageSubresource of srcImage
    • For each element of pRegions, imageSubresource.aspectMask must specify aspects present in srcImage
    • If srcImage has a multi-planar format, then for each element of pRegions, imageSubresource.aspectMask must be IMAGE_ASPECT_PLANE_0_BIT, IMAGE_ASPECT_PLANE_1_BIT, or IMAGE_ASPECT_PLANE_2_BIT (with IMAGE_ASPECT_PLANE_2_BIT valid only for image formats with three planes)
    • If srcImage is of type IMAGE_TYPE_3D, for each element of pRegions, imageSubresource.baseArrayLayer must be 0 and imageSubresource.layerCount must be 1
    • If srcImage is not a blocked image, for each element of pRegions, bufferRowLength multiplied by the texel block size of srcImage must be less than or equal to 231-1
    • If srcImage is a blocked image, for each element of pRegions, bufferRowLength divided by the compressed texel block width and then multiplied by the texel block size of srcImage must be less than or equal to 231-1
    • If the queue family used to create the VkCommandPool which commandBuffer was allocated from does not support QUEUE_GRAPHICS_BIT or QUEUE_COMPUTE_BIT, the bufferOffset member of any element of pRegions must be a multiple of 4
    • If srcImage has a depth/stencil format, the bufferOffset member of any element of pRegions must be a multiple of 4
    Valid Usage (Implicit)
    • sType must be STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2
    • pNext must be NULL
    • srcBuffer must be a valid VkBuffer handle
    • dstImage must be a valid VkImage handle
    • dstImageLayout must be a valid VkImageLayout value
    • pRegions must be a valid pointer to an array of regionCount valid VkBufferImageCopy2 structures
    • regionCount must be greater than 0
    • Both of dstImage, and srcBuffer must have been created, allocated, or retrieved from the same VkDevice
    See Also

    VkBufferImageCopy2, CmdCopyBufferToImage2, CmdCopyBufferToImage2KHR

    Layout

    
     struct VkCopyBufferToImageInfo2 {
         VkStructureType sType();
         void const * pNext();
         VkBuffer srcBuffer();
         VkImage dstImage();
         VkImageLayout dstImageLayout();
         uint32_t regionCount();
         VkBufferImageCopy2 const * pRegions();
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • STYPE, PNEXT, SRCBUFFER, DSTIMAGE, DSTIMAGELAYOUT, REGIONCOUNT, PREGIONS

        The struct member offsets.
    • Constructor Detail

      • VkCopyBufferToImageInfo2

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

        public int sType()
        the type of this structure.
      • pNext

        public long pNext()
        NULL or a pointer to a structure extending this structure.
      • srcBuffer

        public long srcBuffer()
        the source buffer.
      • dstImage

        public long dstImage()
        the destination image.
      • dstImageLayout

        public int dstImageLayout()
        the layout of the destination image subresources for the copy.
      • regionCount

        public int regionCount()
        the number of regions to copy.
      • malloc

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

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

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

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

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

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

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

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

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

        public static long nsrcBuffer​(long struct)
        Unsafe version of srcBuffer().
      • ndstImage

        public static long ndstImage​(long struct)
        Unsafe version of dstImage().
      • ndstImageLayout

        public static int ndstImageLayout​(long struct)
        Unsafe version of dstImageLayout().
      • nregionCount

        public static int nregionCount​(long struct)
        Unsafe version of regionCount().
      • 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.
      • nsrcBuffer

        public static void nsrcBuffer​(long struct,
                                      long value)
        Unsafe version of srcBuffer.
      • ndstImage

        public static void ndstImage​(long struct,
                                     long value)
        Unsafe version of dstImage.
      • ndstImageLayout

        public static void ndstImageLayout​(long struct,
                                           int value)
        Unsafe version of dstImageLayout.
      • nregionCount

        public static void nregionCount​(long struct,
                                        int value)
        Sets the specified value to the regionCount field of the specified struct.
      • validate

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