Class VkCopyMemoryToImageInfo

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<VkCopyMemoryToImageInfo>
org.lwjgl.vulkan.VkCopyMemoryToImageInfo
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer
Direct Known Subclasses:
VkCopyMemoryToImageInfoEXT

public class VkCopyMemoryToImageInfo extends org.lwjgl.system.Struct<VkCopyMemoryToImageInfo> implements org.lwjgl.system.NativeResource
Structure specifying parameters of host memory to image copy command.
Description

vkCopyMemoryToImage does not check whether the device memory associated with dstImage is currently in use before performing the copy. The application must guarantee that any previously submitted command that reads from or writes to the copy regions has completed before the host performs the copy.

Copy regions for the image must be aligned to a multiple of the texel block extent in each dimension, except at the edges of the image, where region extents must match the edge of the image.

Valid Usage
  • If dstImage is non-sparse then the image or the specified disjoint plane must be bound completely and contiguously to a single VkDeviceMemory object
  • The dstSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when dstImage was created
  • If dstSubresource.layerCount is not REMAINING_ARRAY_LAYERS, dstSubresource.baseArrayLayer + dstSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when dstImage was created
  • dstImage must not have been created with flags containing IMAGE_CREATE_SUBSAMPLED_BIT_EXT
  • The image region specified by each element of pRegions must be contained within the specified dstSubresource of dstImage
  • For each element of pRegions, dstOffset.x and (extent.width + dstOffset.x) must both be greater than or equal to 0 and less than or equal to the width of the specified dstSubresource of dstImage
  • For each element of pRegions, dstOffset.y and (extent.height + dstOffset.y) must both be greater than or equal to 0 and less than or equal to the height of the specified dstSubresource of dstImage
  • For each element of pRegions, bufferRowLength must be a multiple of the texel block extent width of the VkFormat of dstImage
  • For each element of pRegions, bufferImageHeight must be a multiple of the texel block extent height of the VkFormat of dstImage
  • For each element of pRegions, bufferRowLength divided by the texel block extent width and then multiplied by the texel block size of dstImage must be less than or equal to 231-1
  • dstImageLayout must specify the current layout of the image subresources of dstImage specified in pRegions
  • dstImageLayout must be one of the image layouts returned in VkPhysicalDeviceHostImageCopyProperties::pCopyDstLayouts
  • If flags includes HOST_IMAGE_COPY_MEMCPY, for each region in pRegions, memoryRowLength and memoryImageHeight must both be 0
Valid Usage (Implicit)
  • sType must be STRUCTURE_TYPE_COPY_MEMORY_TO_IMAGE_INFO
  • pNext must be NULL
  • flags must be a valid combination of VkHostImageCopyFlagBits values
  • 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 VkMemoryToImageCopy structures
  • regionCount must be greater than 0
See Also

VkMemoryToImageCopy, CopyMemoryToImage, CopyMemoryToImageEXT

Layout


 struct VkCopyMemoryToImageInfo {
     VkStructureType sType();
     void const * pNext();
     VkHostImageCopyFlags flags();
     VkImage dstImage();
     VkImageLayout dstImageLayout();
     uint32_t regionCount();
     VkMemoryToImageCopy const * pRegions();
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • STYPE

      public static final int STYPE
      The struct member offsets.
    • PNEXT

      public static final int PNEXT
      The struct member offsets.
    • FLAGS

      public static final int FLAGS
      The struct member offsets.
    • DSTIMAGE

      public static final int DSTIMAGE
      The struct member offsets.
    • DSTIMAGELAYOUT

      public static final int DSTIMAGELAYOUT
      The struct member offsets.
    • REGIONCOUNT

      public static final int REGIONCOUNT
      The struct member offsets.
    • PREGIONS

      public static final int PREGIONS
      The struct member offsets.
  • Constructor Details

    • VkCopyMemoryToImageInfo

      public VkCopyMemoryToImageInfo(ByteBuffer container)
      Creates a VkCopyMemoryToImageInfo 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 Details

    • sizeof

      public int sizeof()
      Specified by:
      sizeof in class org.lwjgl.system.Struct<VkCopyMemoryToImageInfo>
    • sType

      public int sType()
      a VkStructureType value identifying this structure.
    • pNext

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

      public int flags()
      a bitmask of VkHostImageCopyFlagBits values describing additional copy parameters.
    • 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.
    • pRegions

      public VkMemoryToImageCopy.Buffer pRegions()
      a pointer to an array of VkMemoryToImageCopy structures specifying the regions to copy.
    • sType

      public VkCopyMemoryToImageInfo sType(int value)
      Sets the specified value to the sType() field.
    • sType$Default

      public VkCopyMemoryToImageInfo sType$Default()
    • pNext

      public VkCopyMemoryToImageInfo pNext(long value)
      Sets the specified value to the pNext() field.
    • flags

      public VkCopyMemoryToImageInfo flags(int value)
      Sets the specified value to the flags() field.
    • dstImage

      public VkCopyMemoryToImageInfo dstImage(long value)
      Sets the specified value to the dstImage() field.
    • dstImageLayout

      public VkCopyMemoryToImageInfo dstImageLayout(int value)
      Sets the specified value to the dstImageLayout() field.
    • pRegions

      Sets the address of the specified VkMemoryToImageCopy.Buffer to the pRegions() field.
    • set

      public VkCopyMemoryToImageInfo set(int sType, long pNext, int flags, long dstImage, int dstImageLayout, VkMemoryToImageCopy.Buffer pRegions)
      Initializes this struct with the specified values.
    • set

      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static VkCopyMemoryToImageInfo.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new VkCopyMemoryToImageInfo.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • 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().
    • 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().
    • npRegions

      public static VkMemoryToImageCopy.Buffer npRegions(long struct)
      Unsafe version of pRegions().
    • 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.
    • 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.
    • npRegions

      public static void npRegions(long struct, VkMemoryToImageCopy.Buffer value)
      Unsafe version of pRegions.
    • validate

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