2016-07-11 01:13:41 +00:00
|
|
|
// Copyright (c) 2014-2016 Khronos Group. This work is licensed under a
|
|
|
|
// Creative Commons Attribution 4.0 International License; see
|
|
|
|
// http://creativecommons.org/licenses/by/4.0/
|
|
|
|
|
2016-02-16 09:53:44 +00:00
|
|
|
vkCmdCopyImage(3)
|
2016-07-11 01:13:41 +00:00
|
|
|
=================
|
2016-02-16 09:53:44 +00:00
|
|
|
|
|
|
|
Name
|
|
|
|
----
|
|
|
|
vkCmdCopyImage - Copy data between images.
|
|
|
|
|
|
|
|
C Specification
|
|
|
|
---------------
|
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
// refBegin vkCmdCopyImage Copy data between images.
|
2016-02-16 09:53:44 +00:00
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
To copy data between image objects, call:
|
2016-02-16 09:53:44 +00:00
|
|
|
|
Change log for July 22, 2016 Vulkan 1.0.22 spec update:
* Bump API patch number and header version number to 22 for this update.
Github Issues:
* Translate the subpass self-dependency language into concrete
validity statements, and added a validity statement about the
restrictions on layout parameters (public issue 267).
* Add validity requirement that
slink:VkAttachmentDescription::pname:finalLayout and
slink:VkAttachmentReference::pname:layout must not be
ename:VK_IMAGE_LAYOUT_UNDEFINED or
ename:VK_IMAGE_LAYOUT_PREINITIALIZED (public issue 268).
* Clarify that slink:VkSubpassDescription::pname:pResolveAttachments
layouts are used. Make language consistent with other attachment
arrays (public issue 270).
* Changed 64-bit definition for
dname:VK_DEFINE_NON_DISPATCHABLE_HANDLE to work for x32 platform in
+vk.xml+ and the resulting +vulkan.h+ (public issue 282).
* Add missing error return code for
flink:vkEnumerateInstanceExtensionProperties and
flink:vkEnumerateDeviceExtensionProperties (public issue 285)
* Fix several cases of stext::VkStructName.memberName markup to
stext::VkStructName::pname:memberName, to match other usage in the
spec, and describe this markup in the style guide (public issue
286).
* Modified validity language generation script to avoid redundant
common ancestor language if covered by generic parent language, and
used `Both' instead of `Each' when appropriate (public issue 288).
Internal Issues:
* Add language about behavior of flink:vkAllocateDescriptorSets when
allocation fails due to fragmentation, a new error
ename:VK_ERROR_FRAGMENTED_POOL, and a Note explaining the situation
(internal issue 309).
* For the features of code:PointSize, code:ClipDistance, and
code:CullDistance, the SPIR-V capability is required to be declared
on use (read or write) rather than on decoration (internal issue
359).
* Have desktop versions of GLSL respect precision qualification
(code:mediump and code:lowp) when compiling for Vulkan. These will
get translated to SPIR-V's code:RelaxedPrecision decoration as they
do with OpenGL ES versions of GLSL (ESSL). The default precision of
all types is code:highp when using a desktop version (internal issue
360).
* Add validity statement for slink:VkImageCreateInfo specifying that
multisampled images must be two-dimensional, optimally tiled, and
with a single mipmap level (internal issue 369).
* Add validity statements to slink:VkImageViewCreateInfo disallowing
creation of images or image views with no supported features. Made
some slink:VkImageViewCreateInfo validity statements more precise
and consistent. Added a Note to the <<features,features>> chapter
about formats with no features (internal issue 371).
* Remove +manpages+ from default build targets. Nroff outputs
containing imbedded latexmath will not render properly. Fixing this
is a lot of work for limited use cases (internal issue 401).
Other Commits:
* Fix flink:vkRenderPassBeginInfo::pname:clearValueCount validity
statement to be based on attachment indices rather than the number
of cleared attachments
(Vulkan-LoaderAndValidationLayers/issues/601).
* Convert registry documentation from LaTeX to asciidoc source and
rename from +src/spec/readme.tex+ to +src/spec/registry.txt+.
* Fix lack of Oxford commas in validity language.
* Lots of cleanup of generator scripts and Makefiles to move extension
list for generator into the script arguments instead of the body of
genvk.py, and express better dependencies between XML, scripts, and
generated files.
2016-07-23 10:15:48 +00:00
|
|
|
include::../api/protos/vkCmdCopyImage.txt[]
|
2016-02-16 09:53:44 +00:00
|
|
|
|
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
Parameters
|
|
|
|
----------
|
2016-02-16 09:53:44 +00:00
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
* pname:commandBuffer is the command buffer into which the command will be
|
|
|
|
recorded.
|
|
|
|
* pname:srcImage is the source image.
|
|
|
|
* pname:srcImageLayout is the current layout of the source image
|
|
|
|
subresource.
|
|
|
|
* pname:dstImage is the destination image.
|
|
|
|
* pname:dstImageLayout is the current layout of the destination image
|
|
|
|
subresource.
|
|
|
|
* pname:regionCount is the number of regions to copy.
|
|
|
|
* pname:pRegions is a pointer to an array of slink:VkImageCopy structures
|
|
|
|
specifying the regions to copy.
|
2016-02-16 09:53:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
Description
|
|
|
|
-----------
|
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
Each region in pname:pRegions is copied from the source image to the same
|
|
|
|
region of the destination image. pname:srcImage and pname:dstImage can: be
|
|
|
|
the same image or alias the same memory.
|
|
|
|
|
|
|
|
Copies are done layer by layer starting with pname:baseArrayLayer member of
|
|
|
|
pname:srcSubresource for the source and pname:dstSubresource for the
|
|
|
|
destination. pname:layerCount layers are copied to the destination image.
|
|
|
|
|
|
|
|
[[copies-images-format-compatibility]]
|
|
|
|
The formats of pname:srcImage and pname:dstImage must: be compatible.
|
|
|
|
Formats are considered compatible if their texel size in bytes is the same
|
|
|
|
between both formats. For example, ename:VK_FORMAT_R8G8B8A8_UNORM is
|
|
|
|
compatible with ename:VK_FORMAT_R32_UINT because both texels are 4
|
|
|
|
bytes in size. Depth/stencil formats must: match exactly.
|
|
|
|
|
|
|
|
fname:vkCmdCopyImage allows copying between size-compatible compressed
|
|
|
|
and uncompressed internal formats. Formats are size-compatible if the texel
|
|
|
|
size of the uncompressed format is equal to the compressed texel block size in
|
|
|
|
bytes of the compressed format. Such a copy does not perform on-the-fly
|
|
|
|
compression or decompression. When copying from an uncompressed format to a
|
|
|
|
compressed format, each texel of uncompressed data of the source image is
|
|
|
|
copied as a raw value to the corresponding compressed texel block of the
|
|
|
|
destination image. When copying from a compressed format to an uncompressed
|
|
|
|
format, each compressed texel block of the source image is copied as a raw
|
|
|
|
value to the corresponding texel of uncompressed data in the destination
|
|
|
|
image. Thus, for example, it is legal to copy between a 128-bit uncompressed
|
|
|
|
format and a compressed format which has a 128-bit sized compressed texel
|
|
|
|
block representing 4x4 texels (using 8 bits per texel), or between a 64-bit
|
|
|
|
uncompressed format and a compressed format which has a 64-bit sized
|
|
|
|
compressed texel block representing 4x4 texels (using 4 bits per texel).
|
|
|
|
|
|
|
|
When copying between compressed and uncompressed formats the pname:extent
|
|
|
|
members represent the texel dimensions of the source image and not the
|
|
|
|
destination. When copying from a compressed image to an uncompressed image
|
|
|
|
the image texel dimensions written to the uncompressed image will be source
|
|
|
|
extent divided by the compressed texel block dimensions. When copying from an
|
|
|
|
uncompressed image to a compressed image the image texel dimensions written
|
|
|
|
to the compressed image will be the source extent multiplied by the
|
|
|
|
compressed texel block dimensions. In both cases the number of bytes read and
|
|
|
|
the number of bytes written will be identical.
|
|
|
|
|
|
|
|
Copying to or from block-compressed images is typically done in multiples of
|
|
|
|
the compressed texel block. For this reason the pname:extent must: be a
|
|
|
|
multiple of the compressed texel block dimension. There is one exception to
|
|
|
|
this rule which is required: to handle compressed images created with
|
|
|
|
dimensions that are not a multiple of the compressed texel block dimensions.
|
|
|
|
If the pname:srcImage is compressed and if pname:extent.width is not a
|
|
|
|
multiple of the compressed texel block width then (pname:extent.width +
|
|
|
|
pname:srcOffset.x) must: equal the image subresource width, if
|
|
|
|
pname:extent.height is not a multiple of the compressed texel block height
|
|
|
|
then (pname:extent.height + pname:srcOffset.y) must: equal the image
|
|
|
|
subresource height and if pname:extent.depth is not a multiple of the
|
|
|
|
compressed texel block depth then (pname:extent.depth + pname:srcOffset.z)
|
|
|
|
must: equal the image subresource depth. Similarly, if the pname:dstImage is
|
|
|
|
compressed and if pname:extent.width is not a multiple of the compressed
|
|
|
|
texel block width then (pname:extent.width + pname:dstOffset.x) must: equal
|
|
|
|
the image subresource width, if pname:extent.height is not a multiple of the
|
|
|
|
compressed texel block height then (pname:extent.height + pname:dstOffset.y)
|
|
|
|
must: equal the image subresource height and if pname:extent.depth is not a
|
|
|
|
multiple of the compressed texel block depth then (pname:extent.depth +
|
|
|
|
pname:dstOffset.z) must: equal the image subresource depth. This allows the
|
|
|
|
last compressed texel block of the image in each non-multiple dimension to
|
|
|
|
be included as a source or destination of the copy.
|
|
|
|
|
|
|
|
fname:vkCmdCopyImage can: be used to copy image data between multisample
|
|
|
|
images, but both images must: have the same number of samples.
|
2016-02-16 09:53:44 +00:00
|
|
|
|
|
|
|
include::../validity/protos/vkCmdCopyImage.txt[]
|
|
|
|
|
|
|
|
|
|
|
|
See Also
|
|
|
|
--------
|
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
slink:VkCommandBuffer, slink:VkImage, slink:VkImageCopy, elink:VkImageLayout
|
|
|
|
|
|
|
|
|
|
|
|
Document Notes
|
|
|
|
--------------
|
|
|
|
|
|
|
|
For more information, see the Vulkan Specification at URL
|
|
|
|
|
|
|
|
https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkCmdCopyImage
|
|
|
|
|
|
|
|
This page is extracted from the Vulkan Specification.
|
|
|
|
Fixes and changes should be made to the Specification,not directly.
|
2016-02-16 09:53:44 +00:00
|
|
|
|
|
|
|
include::footer.txt[]
|
2016-07-11 01:13:41 +00:00
|
|
|
|