Class NVCopyMemoryIndirect

java.lang.Object
org.lwjgl.vulkan.NVCopyMemoryIndirect

public class NVCopyMemoryIndirect extends Object
This extension adds support for performing copies between memory and image regions using indirect parameters that are read by the device from a buffer during execution. This functionality may be useful for performing copies where the copy parameters are not known during the command buffer creation time.
Name String
VK_NV_copy_memory_indirect
Extension Type
Device extension
Registered Extension Number
427
Revision
1
Extension and Version Dependencies
VK_KHR_get_physical_device_properties2 or Version 1.1 and VK_KHR_buffer_device_address or Version 1.2
Contact
Other Extension Metadata
Last Modified Date
2022-10-14
Contributors
  • Vikram Kushwaha, NVIDIA
  • Jeff Bolz, NVIDIA
  • Christoph Kubisch, NVIDIA
  • Daniel Koch, NVIDIA
  • Field Details

  • Method Details

    • vkCmdCopyMemoryIndirectNV

      public static void vkCmdCopyMemoryIndirectNV(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, long copyBufferAddress, int copyCount, int stride)
      Copy data between memory regions.
      C Specification

      To copy data between two memory regions by specifying copy parameters indirectly in a buffer, call:

      
       void vkCmdCopyMemoryIndirectNV(
           VkCommandBuffer                             commandBuffer,
           VkDeviceAddress                             copyBufferAddress,
           uint32_t                                    copyCount,
           uint32_t                                    stride);
      Description

      Each region read from copyBufferAddress is copied from the source region to the specified destination region. The results are undefined if any of the source and destination regions overlap in memory.

      Valid Usage
      Valid Usage (Implicit)
      • commandBuffer must be a valid VkCommandBuffer handle
      • commandBuffer must be in the recording state
      • The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations
      • This command must only be called outside of a render pass instance
      • This command must only be called outside of a video coding scope
      Host Synchronization
      • Host access to commandBuffer must be externally synchronized
      • Host access to the VkCommandPool that commandBuffer was allocated from must be externally synchronized
      Command Properties
      Command Buffer LevelsRender Pass ScopeVideo Coding ScopeSupported Queue TypesCommand Type
      Primary SecondaryOutsideOutsideTransfer Graphics ComputeAction
      Parameters:
      commandBuffer - the command buffer into which the command will be recorded.
      copyBufferAddress - the buffer address specifying the copy parameters. This buffer is laid out in memory as an array of VkCopyMemoryIndirectCommandNV structures.
      copyCount - the number of copies to execute, and can be zero.
      stride - the stride in bytes between successive sets of copy parameters.
    • nvkCmdCopyMemoryToImageIndirectNV

      public static void nvkCmdCopyMemoryToImageIndirectNV(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, long copyBufferAddress, int copyCount, int stride, long dstImage, int dstImageLayout, long pImageSubresources)
      Parameters:
      copyCount - the number of copies to execute, and can be zero.
    • vkCmdCopyMemoryToImageIndirectNV

      public static void vkCmdCopyMemoryToImageIndirectNV(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, long copyBufferAddress, int stride, long dstImage, int dstImageLayout, VkImageSubresourceLayers.Buffer pImageSubresources)
      Copy data from a memory region into an image.
      C Specification

      To copy data from a memory region to an image object by specifying copy parameters in a buffer, call:

      
       void vkCmdCopyMemoryToImageIndirectNV(
           VkCommandBuffer                             commandBuffer,
           VkDeviceAddress                             copyBufferAddress,
           uint32_t                                    copyCount,
           uint32_t                                    stride,
           VkImage                                     dstImage,
           VkImageLayout                               dstImageLayout,
           const VkImageSubresourceLayers*             pImageSubresources);
      Description

      Each region in copyBufferAddress is copied from the source memory region to an image region in the destination image. If the destination image is of type IMAGE_TYPE_3D, the starting slice and number of slices to copy are specified in pImageSubresources→baseArrayLayer and pImageSubresources→layerCount respectively. The copy must be performed on a queue that supports indirect copy operations, see VkPhysicalDeviceCopyMemoryIndirectPropertiesNV.

      Valid Usage
      • The indirectCopy feature must be enabled
      • dstImage must not be a protected image
      • The aspectMask member for every subresource in pImageSubresources must only have a single bit set
      • The image region specified by each element in copyBufferAddress must be a region that is contained within dstImage
      • 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
      Valid Usage (Implicit)
      • commandBuffer must be a valid VkCommandBuffer handle
      • dstImage must be a valid VkImage handle
      • dstImageLayout must be a valid VkImageLayout value
      • pImageSubresources must be a valid pointer to an array of copyCount valid VkImageSubresourceLayers structures
      • commandBuffer must be in the recording state
      • The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations
      • This command must only be called outside of a render pass instance
      • This command must only be called outside of a video coding scope
      • copyCount must be greater than 0
      • Both of commandBuffer, and dstImage must have been created, allocated, or retrieved from the same VkDevice
      Host Synchronization
      • Host access to commandBuffer must be externally synchronized
      • Host access to the VkCommandPool that commandBuffer was allocated from must be externally synchronized
      Command Properties
      Command Buffer LevelsRender Pass ScopeVideo Coding ScopeSupported Queue TypesCommand Type
      Primary SecondaryOutsideOutsideTransfer Graphics ComputeAction
      See Also

      VkImageSubresourceLayers

      Parameters:
      commandBuffer - the command buffer into which the command will be recorded.
      copyBufferAddress - the buffer address specifying the copy parameters. This buffer is laid out in memory as an array of VkCopyMemoryToImageIndirectCommandNV structures.
      stride - the byte stride between successive sets of copy parameters.
      dstImage - the destination image.
      dstImageLayout - the layout of the destination image subresources for the copy.
      pImageSubresources - a pointer to an array of size copyCount of VkImageSubresourceLayers used to specify the specific image subresource of the destination image data for that copy.