Movatterモバイル変換


[0]ホーム

URL:


Vulkan API Reference Pageslatest

vkCmdCopyBufferToImage(3)

Name

vkCmdCopyBufferToImage - Copy data from a buffer into an image

C Specification

To copy data from a buffer object to an image object, call:

// Provided by VK_VERSION_1_0void vkCmdCopyBufferToImage(    VkCommandBuffer                             commandBuffer,    VkBuffer                                    srcBuffer,    VkImage                                     dstImage,    VkImageLayout                               dstImageLayout,    uint32_t                                    regionCount,    const VkBufferImageCopy*                    pRegions);

Parameters

  • commandBuffer is the command buffer into which the command will berecorded.

  • srcBuffer is the source buffer.

  • dstImage is the destination image.

  • dstImageLayout is the layout of the destination image subresourcesfor the copy.

  • regionCount is the number of regions to copy.

  • pRegions is a pointer to an array ofVkBufferImageCopystructures specifying the regions to copy.

Description

Each source region specified bypRegions is copied from the sourcebuffer to the destination region of the destination image according to theaddressing calculations for eachresource.If any of the specified regions insrcBuffer overlaps in memory withany of the specified regions indstImage, values read from thoseoverlapping regions areundefined.If any region accesses a depth aspect indstImageand theVK_EXT_depth_range_unrestricted extension is not enabled,values copied fromsrcBuffer outside of the range[0,1] will bewritten asundefined values to the destination image.

Copy regions for the imagemust be aligned to a multiple of the texel blockextent in each dimension, except at the edges of the image, where regionextentsmust match the edge of the image.

Valid Usage
  • VUID-vkCmdCopyBufferToImage-dstImage-07966
    IfdstImage is non-sparse then the imageor each specifieddisjoint planemust be bound completely and contiguously to a singleVkDeviceMemory object

  • VUID-vkCmdCopyBufferToImage-imageSubresource-07967
    TheimageSubresource.mipLevel member of each element ofpRegionsmust be less than themipLevels specified inVkImageCreateInfo whendstImage was created

  • VUID-vkCmdCopyBufferToImage-imageSubresource-07968
    IfimageSubresource.layerCount is notVK_REMAINING_ARRAY_LAYERS,imageSubresource.baseArrayLayer +imageSubresource.layerCount of each element ofpRegionsmust be less than or equal to thearrayLayers specified inVkImageCreateInfo whendstImage was created

  • VUID-vkCmdCopyBufferToImage-dstImage-07969
    dstImagemust not have been created withflagscontainingVK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT

  • VUID-vkCmdCopyBufferToImage-imageSubresource-07971
    For each element ofpRegions,imageOffset.x and(imageExtent.width +imageOffset.x)mustboth be greater than or equal to0 and less than or equal to the widthof the specifiedimageSubresource ofdstImage

  • VUID-vkCmdCopyBufferToImage-imageSubresource-07972
    For each element ofpRegions,imageOffset.y and(imageExtent.height +imageOffset.y)mustboth be greater than or equal to0 and less than or equal to theheight of the specifiedimageSubresource ofdstImage

  • VUID-vkCmdCopyBufferToImage-pRegions-00171
    srcBuffermust be large enough to contain all buffer locationsthat are accessed according toBuffer and Image Addressing, for each element ofpRegions

  • VUID-vkCmdCopyBufferToImage-pRegions-00173
    The union of all source regions, and the union of all destinationregions, specified by the elements ofpRegions,must not overlapin memory

  • VUID-vkCmdCopyBufferToImage-srcBuffer-00174
    srcBuffermust have been created with theVK_BUFFER_USAGE_TRANSFER_SRC_BIT usage flag set

  • VUID-vkCmdCopyBufferToImage-dstImage-01997
    Theformat features ofdstImagemust containVK_FORMAT_FEATURE_TRANSFER_DST_BIT

  • VUID-vkCmdCopyBufferToImage-srcBuffer-00176
    IfsrcBuffer is non-sparse then itmust be bound completely andcontiguously to a singleVkDeviceMemory object

  • VUID-vkCmdCopyBufferToImage-dstImage-00177
    dstImagemust have been created with theVK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag set

  • VUID-vkCmdCopyBufferToImage-dstImageLayout-00180
    dstImageLayoutmust specify the layout of the image subresourcesofdstImage specified inpRegions at the time this commandis executed on aVkDevice

  • VUID-vkCmdCopyBufferToImage-dstImageLayout-01396
    dstImageLayoutmust beVK_IMAGE_LAYOUT_SHARED_PRESENT_KHR,VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, orVK_IMAGE_LAYOUT_GENERAL

  • VUID-vkCmdCopyBufferToImage-pRegions-07931
    IfVK_EXT_depth_range_unrestricted is not enabled, foreach element ofpRegions whoseimageSubresource contains adepth aspect, the data insrcBuffermust be in the range[0,1]

  • VUID-vkCmdCopyBufferToImage-bufferRowLength-09106
    For each element ofpRegions,bufferRowLengthmust be amultiple of thetexel block extent width of theVkFormat ofdstImage

  • VUID-vkCmdCopyBufferToImage-bufferImageHeight-09107
    For each element ofpRegions,bufferImageHeightmust be amultiple of thetexel block extent height of theVkFormat ofdstImage

  • VUID-vkCmdCopyBufferToImage-bufferRowLength-09108
    For each element ofpRegions,bufferRowLength divided bythetexel block extent width and thenmultiplied by the texel block size ofdstImagemust be lessthan or equal to231-1

  • VUID-vkCmdCopyBufferToImage-dstImage-07975
    IfdstImage does not have either a depth/stencil formator amulti-planar format,then for each element ofpRegions,bufferOffsetmust be amultiple of thetexel block size

  • VUID-vkCmdCopyBufferToImage-dstImage-07976
    IfdstImage has amulti-planar format, then for each element ofpRegions,bufferOffsetmust be a multiple of the element size of the compatible format for theformat and theaspectMask of theimageSubresource as definedinCompatible Formats of Planes of Multi-Planar Formats

  • VUID-vkCmdCopyBufferToImage-dstImage-07978
    IfdstImage has a depth/stencil format, thebufferOffsetmember of any element ofpRegionsmust be a multiple of4

Valid Usage (Implicit)
  • VUID-vkCmdCopyBufferToImage-commandBuffer-parameter
    commandBuffermust be a validVkCommandBuffer handle

  • VUID-vkCmdCopyBufferToImage-srcBuffer-parameter
    srcBuffermust be a validVkBuffer handle

  • VUID-vkCmdCopyBufferToImage-dstImage-parameter
    dstImagemust be a validVkImage handle

  • VUID-vkCmdCopyBufferToImage-dstImageLayout-parameter
    dstImageLayoutmust be a validVkImageLayout value

  • VUID-vkCmdCopyBufferToImage-pRegions-parameter
    pRegionsmust be a valid pointer to an array ofregionCount validVkBufferImageCopy structures

  • VUID-vkCmdCopyBufferToImage-commandBuffer-recording
    commandBuffermust be in therecording state

  • VUID-vkCmdCopyBufferToImage-commandBuffer-cmdpool
    TheVkCommandPool thatcommandBuffer was allocated frommust supportVK_QUEUE_COMPUTE_BIT,VK_QUEUE_GRAPHICS_BIT, orVK_QUEUE_TRANSFER_BIT operations

  • VUID-vkCmdCopyBufferToImage-renderpass
    This commandmust only be called outside of a render pass instance

  • VUID-vkCmdCopyBufferToImage-suspended
    This commandmust not be called between suspended render pass instances

  • VUID-vkCmdCopyBufferToImage-videocoding
    This commandmust only be called outside of a video coding scope

  • VUID-vkCmdCopyBufferToImage-regionCount-arraylength
    regionCountmust be greater than0

  • VUID-vkCmdCopyBufferToImage-commonparent
    Each ofcommandBuffer,dstImage, andsrcBuffermust have been created, allocated, or retrieved from the sameVkDevice

Host Synchronization
  • Host access tocommandBuffermust be externally synchronized

  • Host access to theVkCommandPool thatcommandBuffer was allocated frommust be externally synchronized

Command Properties
Command Buffer LevelsRender Pass ScopeVideo Coding ScopeSupported Queue TypesCommand Type

Primary
Secondary

Outside

Outside

VK_QUEUE_COMPUTE_BIT
VK_QUEUE_GRAPHICS_BIT
VK_QUEUE_TRANSFER_BIT

Action

Conditional Rendering

vkCmdCopyBufferToImage is not affected byconditional rendering

See Also

Document Notes

For more information, see theVulkan Specification.

This page is extracted from the Vulkan Specification.Fixes and changes should be made to the Specification, not directly.


[8]ページ先頭

©2009-2026 Movatter.jp