| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Vulkan.Extensions.VK_EXT_host_image_copy
Description
Name
VK_EXT_host_image_copy - device extension
VK_EXT_host_image_copy
- Name String
VK_EXT_host_image_copy
- Extension Type
- Device extension
- Registered Extension Number
- 271
- Revision
- 1
- Ratification Status
- Ratified
- Extension and Version Dependencies
- VK_KHR_get_physical_device_properties2 and VK_KHR_copy_commands2 and VK_KHR_format_feature_flags2
- Contact
- Extension Proposal
- VK_EXT_host_image_copy
Other Extension Metadata
- Last Modified Date
- 2023-04-26
- Contributors
- Shahbaz Youssefi, Google
- Faith Ekstrand, Collabora
- Hans-Kristian Arntzen, Valve
- Piers Daniell, NVIDIA
- Jan-Harald Fredriksen, Arm
- James Fitzpatrick, Imagination
- Daniel Story, Nintendo
Description
This extension allows applications to copy data between host memory and images on the host processor, without staging the data through a GPU-accessible buffer. This removes the need to allocate and manage the buffer and its associated memory. On some architectures it may also eliminate an extra copy operation. This extension additionally allows applications to copy data between images on the host.
To support initializing a new image in preparation for a host copy, it
is now possible to transition a new image to
IMAGE_LAYOUT_GENERAL or other
host-copyable layouts via transitionImageLayoutEXT. Additionally, it
is possible to perform copies that preserve the swizzling layout of the
image by using the HOST_IMAGE_COPY_MEMCPY_EXT flag. In that case, the
memory size needed for copies to or from a buffer can be retrieved by
chaining SubresourceHostMemcpySizeEXT to pLayout in
getImageSubresourceLayout2EXT.
New Commands
New Structures
CopyImageToMemoryInfoEXTCopyMemoryToImageInfoEXTHostImageLayoutTransitionInfoEXTImageSubresource2EXTImageToMemoryCopyEXTMemoryToImageCopyEXTSubresourceLayout2EXTExtending
ImageFormatProperties2:Extending
PhysicalDeviceFeatures2,DeviceCreateInfo:Extending
PhysicalDeviceProperties2:Extending
SubresourceLayout2KHR:
New Enums
New Bitmasks
New Enum Constants
EXT_HOST_IMAGE_COPY_SPEC_VERSIONExtending
FormatFeatureFlagBits2:Extending
ImageUsageFlagBits:Extending
StructureType:STRUCTURE_TYPE_COPY_IMAGE_TO_IMAGE_INFO_EXTSTRUCTURE_TYPE_COPY_IMAGE_TO_MEMORY_INFO_EXTSTRUCTURE_TYPE_COPY_MEMORY_TO_IMAGE_INFO_EXTSTRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY_EXTSTRUCTURE_TYPE_HOST_IMAGE_LAYOUT_TRANSITION_INFO_EXTSTRUCTURE_TYPE_IMAGE_TO_MEMORY_COPY_EXTSTRUCTURE_TYPE_MEMORY_TO_IMAGE_COPY_EXTSTRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES_EXTSTRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES_EXTSTRUCTURE_TYPE_SUBRESOURCE_HOST_MEMCPY_SIZE_EXT
Issues
1) When uploading data to an image, the data is usually loaded from
disk. Why not have the application load the data directly into a
DeviceMemory bound to a buffer (instead of host
memory), and use
cmdCopyBufferToImage? The same
could be done when downloading data from an image.
RESOLVED: This may not always be possible. Complicated Vulkan applications such as game engines often have decoupled subsystems for streaming data and rendering. It may be unreasonable to require the streaming subsystem to coordinate with the rendering subsystem to allocate memory on its behalf, especially as Vulkan may not be the only API supported by the engine. In emulation layers, the image data is necessarily provided by the application in host memory, so an optimization as suggested is not possible. Most importantly, the device memory may not be mappable by an application, but still accessible to the driver.
2) Are optimalBufferCopyOffsetAlignment and
optimalBufferCopyRowPitchAlignment applicable to host memory as well
with the functions introduced by this extension? Or should there be new
limits?
RESOLVED: No alignment requirements for the host memory pointer.
3) Should there be granularity requirements for image offsets and extents?
RESOLVED: No granularity requirements, i.e. a granularity of 1 pixel (for non-compressed formats) and 1 texel block (for compressed formats) is assumed.
4) How should the application deal with layout transitions before or after copying to or from images?
RESOLVED: An existing issue with linear images is that when emulating other APIs, it is impossible to know when to transition them as they are written to by the host and then used bindlessly. The copy operations in this extension are affected by the same limitation. A new command is thus introduced by this extension to address this problem by allowing the host to perform an image layout transition between a handful of layouts.
Version History
Revision 0, 2021-01-20 (Faith Ekstrand)
- Initial idea and xml
Revision 1, 2023-04-26 (Shahbaz Youssefi)
- Initial revision
See Also
CopyImageToImageInfoEXT, CopyImageToMemoryInfoEXT,
CopyMemoryToImageInfoEXT, HostImageCopyDevicePerformanceQueryEXT,
HostImageCopyFlagBitsEXT, HostImageCopyFlagsEXT,
HostImageLayoutTransitionInfoEXT, ImageSubresource2EXT,
ImageToMemoryCopyEXT, MemoryToImageCopyEXT,
PhysicalDeviceHostImageCopyFeaturesEXT,
PhysicalDeviceHostImageCopyPropertiesEXT,
SubresourceHostMemcpySizeEXT, SubresourceLayout2EXT,
copyImageToImageEXT, copyImageToMemoryEXT, copyMemoryToImageEXT,
getImageSubresourceLayout2EXT, transitionImageLayoutEXT
Document Notes
For more information, see the Vulkan Specification
This page is a generated document. Fixes and changes should be made to the generator scripts, not directly.
Synopsis
- copyMemoryToImageEXT :: forall io. MonadIO io => Device -> CopyMemoryToImageInfoEXT -> io ()
- copyImageToMemoryEXT :: forall io. MonadIO io => Device -> CopyImageToMemoryInfoEXT -> io ()
- copyImageToImageEXT :: forall io. MonadIO io => Device -> CopyImageToImageInfoEXT -> io ()
- transitionImageLayoutEXT :: forall io. MonadIO io => Device -> ("transitions" ::: Vector HostImageLayoutTransitionInfoEXT) -> io ()
- getImageSubresourceLayout2EXT :: forall {a :: [Type]} {io}. (Extendss SubresourceLayout2KHR a, PokeChain a, PeekChain a, MonadIO io) => Device -> Image -> ImageSubresource2KHR -> io (SubresourceLayout2KHR a)
- data PhysicalDeviceHostImageCopyFeaturesEXT = PhysicalDeviceHostImageCopyFeaturesEXT {}
- data PhysicalDeviceHostImageCopyPropertiesEXT = PhysicalDeviceHostImageCopyPropertiesEXT {}
- data MemoryToImageCopyEXT = MemoryToImageCopyEXT {}
- data ImageToMemoryCopyEXT = ImageToMemoryCopyEXT {}
- data CopyMemoryToImageInfoEXT = CopyMemoryToImageInfoEXT {}
- data CopyImageToMemoryInfoEXT = CopyImageToMemoryInfoEXT {}
- data CopyImageToImageInfoEXT = CopyImageToImageInfoEXT {}
- data HostImageLayoutTransitionInfoEXT = HostImageLayoutTransitionInfoEXT {}
- data SubresourceHostMemcpySizeEXT = SubresourceHostMemcpySizeEXT {
- size :: DeviceSize
- data HostImageCopyDevicePerformanceQueryEXT = HostImageCopyDevicePerformanceQueryEXT {}
- type HostImageCopyFlagsEXT = HostImageCopyFlagBitsEXT
- newtype HostImageCopyFlagBitsEXT where
- type ImageSubresource2EXT = ImageSubresource2KHR
- type SubresourceLayout2EXT = SubresourceLayout2KHR
- type EXT_HOST_IMAGE_COPY_SPEC_VERSION = 1
- pattern EXT_HOST_IMAGE_COPY_SPEC_VERSION :: forall a. Integral a => a
- type EXT_HOST_IMAGE_COPY_EXTENSION_NAME = "VK_EXT_host_image_copy"
- pattern EXT_HOST_IMAGE_COPY_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
- data ImageSubresource2KHR = ImageSubresource2KHR {}
- data SubresourceLayout2KHR (es :: [Type]) = SubresourceLayout2KHR {
- next :: Chain es
- subresourceLayout :: SubresourceLayout
- getImageSubresourceLayout2KHR :: forall a io. (Extendss SubresourceLayout2KHR a, PokeChain a, PeekChain a, MonadIO io) => Device -> Image -> ImageSubresource2KHR -> io (SubresourceLayout2KHR a)
Documentation
Arguments
| :: forall io. MonadIO io | |
| => Device |
|
| -> CopyMemoryToImageInfoEXT |
|
| -> io () |
vkCopyMemoryToImageEXT - Copy data from host memory into an image
Description
This command is functionally similar to
cmdCopyBufferToImage2,
except it is executed on the host and reads from host memory instead of
a buffer.
Valid Usage
- The hostImageCopy feature must be enabled
Valid Usage (Implicit)
-
devicemust be a validDevicehandle
-
pCopyMemoryToImageInfomust be a valid pointer to a validCopyMemoryToImageInfoEXTstructure
Return Codes
See Also
Arguments
| :: forall io. MonadIO io | |
| => Device |
|
| -> CopyImageToMemoryInfoEXT |
|
| -> io () |
vkCopyImageToMemoryEXT - Copy image data into host memory
Description
This command is functionally similar to
cmdCopyImageToBuffer2,
except it is executed on the host and writes to host memory instead of a
buffer.
Valid Usage
- The hostImageCopy feature must be enabled
Valid Usage (Implicit)
-
devicemust be a validDevicehandle
-
pCopyImageToMemoryInfomust be a valid pointer to a validCopyImageToMemoryInfoEXTstructure
Return Codes
See Also
Arguments
| :: forall io. MonadIO io | |
| => Device |
|
| -> CopyImageToImageInfoEXT |
|
| -> io () |
vkCopyImageToImageEXT - Copy image data using the host
Description
This command is functionally similar to
cmdCopyImage2,
except it is executed on the host.
Valid Usage
- The hostImageCopy feature must be enabled
Valid Usage (Implicit)
-
devicemust be a validDevicehandle
-
pCopyImageToImageInfomust be a valid pointer to a validCopyImageToImageInfoEXTstructure
Return Codes
See Also
transitionImageLayoutEXT Source #
Arguments
| :: forall io. MonadIO io | |
| => Device |
|
| -> ("transitions" ::: Vector HostImageLayoutTransitionInfoEXT) |
|
| -> io () |
vkTransitionImageLayoutEXT - Perform an image layout transition on the host
Return Codes
See Also
VK_EXT_host_image_copy,
Device, HostImageLayoutTransitionInfoEXT
getImageSubresourceLayout2EXT :: forall {a :: [Type]} {io}. (Extendss SubresourceLayout2KHR a, PokeChain a, PeekChain a, MonadIO io) => Device -> Image -> ImageSubresource2KHR -> io (SubresourceLayout2KHR a) Source #
data PhysicalDeviceHostImageCopyFeaturesEXT Source #
VkPhysicalDeviceHostImageCopyFeaturesEXT - Structure indicating support for copies to or from images from host memory
Members
This structure describes the following feature:
Description
If the PhysicalDeviceHostImageCopyFeaturesEXT structure is included in
the pNext chain of the
PhysicalDeviceFeatures2
structure passed to
getPhysicalDeviceFeatures2,
it is filled in to indicate whether each corresponding feature is
supported. PhysicalDeviceHostImageCopyFeaturesEXT can also be used
in the pNext chain of DeviceCreateInfo to
selectively enable these features.
Valid Usage (Implicit)
See Also
Constructors
| PhysicalDeviceHostImageCopyFeaturesEXT | |
Fields
| |
Instances
data PhysicalDeviceHostImageCopyPropertiesEXT Source #
VkPhysicalDeviceHostImageCopyPropertiesEXT - Structure enumerating image layouts supported by an implementation for host memory copies
Description
If the PhysicalDeviceHostImageCopyPropertiesEXT structure is included
in the pNext chain of the
PhysicalDeviceProperties2
structure passed to
getPhysicalDeviceProperties2,
it is filled in with each corresponding implementation-dependent
property.
If pCopyDstLayouts is NULL, then the number of image layouts that
are supported in CopyMemoryToImageInfoEXT::dstImageLayout and
CopyImageToImageInfoEXT::dstImageLayout is returned in
copyDstLayoutCount. Otherwise, copyDstLayoutCount must be set by
the user to the number of elements in the pCopyDstLayouts array, and
on return the variable is overwritten with the number of values actually
written to pCopyDstLayouts. If the value of copyDstLayoutCount is
less than the number of image layouts that are supported, at most
copyDstLayoutCount values will be written to pCopyDstLayouts. The
implementation must include the
IMAGE_LAYOUT_GENERAL image layout in
pCopyDstLayouts.
If pCopySrcLayouts is NULL, then the number of image layouts that
are supported in CopyImageToMemoryInfoEXT::srcImageLayout and
CopyImageToImageInfoEXT::srcImageLayout is returned in
copySrcLayoutCount. Otherwise, copySrcLayoutCount must be set by
the user to the number of elements in the pCopySrcLayouts array, and
on return the variable is overwritten with the number of values actually
written to pCopySrcLayouts. If the value of copySrcLayoutCount is
less than the number of image layouts that are supported, at most
copySrcLayoutCount values will be written to pCopySrcLayouts. The
implementation must include the
IMAGE_LAYOUT_GENERAL image layout in
pCopySrcLayouts.
The optimalTilingLayoutUUID value can be used to ensure compatible
data layouts when using the HOST_IMAGE_COPY_MEMCPY_EXT flag in
copyMemoryToImageEXT and copyImageToMemoryEXT.
Valid Usage (Implicit)
-
If
copySrcLayoutCountis not0, andpCopySrcLayoutsis notNULL,pCopySrcLayoutsmust be a valid pointer to an array ofcopySrcLayoutCountImageLayoutvalues -
If
copyDstLayoutCountis not0, andpCopyDstLayoutsis notNULL,pCopyDstLayoutsmust be a valid pointer to an array ofcopyDstLayoutCountImageLayoutvalues
See Also
Constructors
| PhysicalDeviceHostImageCopyPropertiesEXT | |
Fields
| |
Instances
data MemoryToImageCopyEXT Source #
VkMemoryToImageCopyEXT - Structure specifying a host memory to image copy operation
Description
This structure is functionally similar to
BufferImageCopy2,
except it defines host memory as the source of copy instead of a buffer.
In particular, the same data packing rules and restrictions as that
structure apply here as well.
Valid Usage
-
pHostPointermust point to memory that is large enough to contain all memory locations that are accessed according to Buffer and Image Addressing, for each element ofpRegions
- The union of all source
regions, and the union of all destination regions, specified by the
elements of
pRegions, must not overlap in memory -
memoryRowLengthmust be0, or greater than or equal to thewidthmember ofimageExtent -
memoryImageHeightmust be0, or greater than or equal to theheightmember ofimageExtent - The
aspectMaskmember ofimageSubresourcemust only have a single bit set -
imageExtent.widthmust not be 0 -
imageExtent.heightmust not be 0 -
imageExtent.depthmust not be 0
Valid Usage (Implicit)
-
sTypemust beSTRUCTURE_TYPE_MEMORY_TO_IMAGE_COPY_EXT
-
pNextmust beNULL -
pHostPointermust be a pointer value -
imageSubresourcemust be a validImageSubresourceLayersstructure
See Also
VK_EXT_host_image_copy,
CopyMemoryToImageInfoEXT, Extent3D,
ImageSubresourceLayers,
Offset3D,
StructureType
Constructors
| MemoryToImageCopyEXT | |
Fields
| |
Instances
data ImageToMemoryCopyEXT Source #
VkImageToMemoryCopyEXT - Structure specifying an image to host memory copy operation
Description
This structure is functionally similar to
BufferImageCopy2,
except it defines host memory as the target of copy instead of a buffer.
In particular, the same data packing rules and restrictions as that
structure apply here as well.
Valid Usage
-
pHostPointermust point to memory that is large enough to contain all memory locations that are accessed according to Buffer and Image Addressing, for each element ofpRegions
- The union of all source
regions, and the union of all destination regions, specified by the
elements of
pRegions, must not overlap in memory -
memoryRowLengthmust be0, or greater than or equal to thewidthmember ofimageExtent -
memoryImageHeightmust be0, or greater than or equal to theheightmember ofimageExtent - The
aspectMaskmember ofimageSubresourcemust only have a single bit set -
imageExtent.widthmust not be 0 -
imageExtent.heightmust not be 0 -
imageExtent.depthmust not be 0
Valid Usage (Implicit)
-
sTypemust beSTRUCTURE_TYPE_IMAGE_TO_MEMORY_COPY_EXT
-
pNextmust beNULL -
pHostPointermust be a pointer value -
imageSubresourcemust be a validImageSubresourceLayersstructure
See Also
VK_EXT_host_image_copy,
CopyImageToMemoryInfoEXT, Extent3D,
ImageSubresourceLayers,
Offset3D,
StructureType
Constructors
| ImageToMemoryCopyEXT | |
Fields
| |
Instances
data CopyMemoryToImageInfoEXT Source #
VkCopyMemoryToImageInfoEXT - Structure specifying parameters of host memory to image copy command
Description
copyMemoryToImageEXT 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
dstImageis sparse then all memory ranges accessed by the copy command must be bound as described in Binding Resource Memory
- If the stencil
aspect of
dstImageis accessed, anddstImagewas not created with separate stencil usage,dstImagemust have been created withIMAGE_USAGE_HOST_TRANSFER_BIT_EXTset inImageCreateInfo::usage - If the stencil
aspect of
dstImageis accessed, anddstImagewas created with separate stencil usage,dstImagemust have been created withIMAGE_USAGE_HOST_TRANSFER_BIT_EXTset inImageStencilUsageCreateInfo::stencilUsage - If non-stencil
aspects of
dstImageare accessed,dstImagemust have been created withIMAGE_USAGE_HOST_TRANSFER_BIT_EXTset inImageCreateInfo::usage - If
flagscontainsHOST_IMAGE_COPY_MEMCPY_EXT, thex,y, andzmembers of theimageOffsetmember of each element ofpRegionsmust be0 - If
flagscontainsHOST_IMAGE_COPY_MEMCPY_EXT, theimageExtentmember of each element ofpRegionsmust equal the extents ofdstImageidentified byimageSubresource - If
dstImageis non-sparse then the image or the specified disjoint plane must be bound completely and contiguously to a singleDeviceMemoryobject - The
imageSubresource.mipLevelmember of each element ofpRegionsmust be less than themipLevelsspecified inImageCreateInfowhendstImagewas created - If
imageSubresource.layerCountis notREMAINING_ARRAY_LAYERS,imageSubresource.baseArrayLayer+imageSubresource.layerCountof each element ofpRegionsmust be less than or equal to thearrayLayersspecified inImageCreateInfowhendstImagewas created -
dstImagemust not have been created withflagscontainingIMAGE_CREATE_SUBSAMPLED_BIT_EXT - The image
region specified by each element of
pRegionsmust be contained within the specifiedimageSubresourceofdstImage - For each
element of
pRegions,imageOffset.xand (imageExtent.width+imageOffset.x) must both be greater than or equal to0and less than or equal to the width of the specifiedimageSubresourceofdstImage - For each
element of
pRegions,imageOffset.yand (imageExtent.height+imageOffset.y) must both be greater than or equal to0and less than or equal to the height of the specifiedimageSubresourceofdstImage -
dstImagemust have a sample count equal toSAMPLE_COUNT_1_BIT - If
dstImageis of typeIMAGE_TYPE_1D, then for each element ofpRegions,imageOffset.ymust be0andimageExtent.heightmust be1 - For each element
of
pRegions,imageOffset.zand (imageExtent.depth+imageOffset.z) must both be greater than or equal to0and less than or equal to the depth of the specifiedimageSubresourceofdstImage - If
dstImageis of typeIMAGE_TYPE_1DorIMAGE_TYPE_2D, then for each element ofpRegions,imageOffset.zmust be0andimageExtent.depthmust be1 - For each element of
pRegions,imageOffset.xmust be a multiple of the texel block extent width of theFormatofdstImage - For each element of
pRegions,imageOffset.ymust be a multiple of the texel block extent height of theFormatofdstImage - For each element of
pRegions,imageOffset.zmust be a multiple of the texel block extent depth of theFormatofdstImage - For each element of
pRegions, if the sum ofimageOffset.xandextent.widthdoes not equal the width of the subresource specified bysrcSubresource,extent.widthmust be a multiple of the texel block extent width of theFormatofdstImage - For each element of
pRegions, if the sum ofimageOffset.yandextent.heightdoes not equal the height of the subresource specified bysrcSubresource,extent.heightmust be a multiple of the texel block extent height of theFormatofdstImage - For each element of
pRegions, if the sum ofimageOffset.zandextent.depthdoes not equal the depth of the subresource specified bysrcSubresource,extent.depthmust be a multiple of the texel block extent depth of theFormatofdstImage - For each
element of
pRegions,imageSubresource.aspectMaskmust specify aspects present indstImage - If
dstImagehas a multi-planar image format, then for each element ofpRegions,imageSubresource.aspectMaskmust be a single valid multi-planar aspect mask bit - If
dstImageis of typeIMAGE_TYPE_3D, for each element ofpRegions,imageSubresource.baseArrayLayermust be0andimageSubresource.layerCountmust be1 - For each
element of
pRegions,memoryRowLengthmust be a multiple of the texel block extent width of theFormatofdstImage - For each
element of
pRegions,memoryImageHeightmust be a multiple of the texel block extent height of theFormatofdstImage - For each
element of
pRegions,memoryRowLengthdivided by the texel block extent width and then multiplied by the texel block size ofdstImagemust be less than or equal to 231-1 -
dstImageLayoutmust specify the current layout of the image subresources ofdstImagespecified inpRegions -
dstImageLayoutmust be one of the image layouts returned inPhysicalDeviceHostImageCopyPropertiesEXT::pCopyDstLayouts - If
flagsincludesHOST_IMAGE_COPY_MEMCPY_EXT, for each region inpRegions,memoryRowLengthandmemoryImageHeightmust both be 0
Valid Usage (Implicit)
-
sTypemust beSTRUCTURE_TYPE_COPY_MEMORY_TO_IMAGE_INFO_EXT
-
pNextmust beNULL -
flagsmust be a valid combination ofHostImageCopyFlagBitsEXTvalues -
dstImagemust be a validImagehandle -
dstImageLayoutmust be a validImageLayoutvalue -
pRegionsmust be a valid pointer to an array ofregionCountvalidMemoryToImageCopyEXTstructures -
regionCountmust be greater than0
See Also
VK_EXT_host_image_copy,
HostImageCopyFlagsEXT, Image,
ImageLayout, MemoryToImageCopyEXT,
StructureType,
copyMemoryToImageEXT
Constructors
| CopyMemoryToImageInfoEXT | |
Fields
| |
Instances
data CopyImageToMemoryInfoEXT Source #
VkCopyImageToMemoryInfoEXT - Structure specifying parameters of an image to host memory copy command
Description
copyImageToMemoryEXT does not check whether the device memory
associated with srcImage is currently in use before performing the
copy. The application must guarantee that any previously submitted
command that 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
srcImageis sparse then all memory ranges accessed by the copy command must be bound as described in Binding Resource Memory
- If the stencil
aspect of
srcImageis accessed, andsrcImagewas not created with separate stencil usage,srcImagemust have been created withIMAGE_USAGE_HOST_TRANSFER_BIT_EXTset inImageCreateInfo::usage - If the stencil
aspect of
srcImageis accessed, andsrcImagewas created with separate stencil usage,srcImagemust have been created withIMAGE_USAGE_HOST_TRANSFER_BIT_EXTset inImageStencilUsageCreateInfo::stencilUsage - If non-stencil
aspects of
srcImageare accessed,srcImagemust have been created withIMAGE_USAGE_HOST_TRANSFER_BIT_EXTset inImageCreateInfo::usage - If
flagscontainsHOST_IMAGE_COPY_MEMCPY_EXT, thex,y, andzmembers of theimageOffsetmember of each element ofpRegionsmust be0 - If
flagscontainsHOST_IMAGE_COPY_MEMCPY_EXT, theimageExtentmember of each element ofpRegionsmust equal the extents ofsrcImageidentified byimageSubresource - If
srcImageis non-sparse then the image or the specified disjoint plane must be bound completely and contiguously to a singleDeviceMemoryobject - The
imageSubresource.mipLevelmember of each element ofpRegionsmust be less than themipLevelsspecified inImageCreateInfowhensrcImagewas created - If
imageSubresource.layerCountis notREMAINING_ARRAY_LAYERS,imageSubresource.baseArrayLayer+imageSubresource.layerCountof each element ofpRegionsmust be less than or equal to thearrayLayersspecified inImageCreateInfowhensrcImagewas created -
srcImagemust not have been created withflagscontainingIMAGE_CREATE_SUBSAMPLED_BIT_EXT - The image
region specified by each element of
pRegionsmust be contained within the specifiedimageSubresourceofsrcImage - For each
element of
pRegions,imageOffset.xand (imageExtent.width+imageOffset.x) must both be greater than or equal to0and less than or equal to the width of the specifiedimageSubresourceofsrcImage - For each
element of
pRegions,imageOffset.yand (imageExtent.height+imageOffset.y) must both be greater than or equal to0and less than or equal to the height of the specifiedimageSubresourceofsrcImage -
srcImagemust have a sample count equal toSAMPLE_COUNT_1_BIT - If
srcImageis of typeIMAGE_TYPE_1D, then for each element ofpRegions,imageOffset.ymust be0andimageExtent.heightmust be1 - For each element
of
pRegions,imageOffset.zand (imageExtent.depth+imageOffset.z) must both be greater than or equal to0and less than or equal to the depth of the specifiedimageSubresourceofsrcImage - If
srcImageis of typeIMAGE_TYPE_1DorIMAGE_TYPE_2D, then for each element ofpRegions,imageOffset.zmust be0andimageExtent.depthmust be1 - For each element of
pRegions,imageOffset.xmust be a multiple of the texel block extent width of theFormatofsrcImage - For each element of
pRegions,imageOffset.ymust be a multiple of the texel block extent height of theFormatofsrcImage - For each element of
pRegions,imageOffset.zmust be a multiple of the texel block extent depth of theFormatofsrcImage - For each element of
pRegions, if the sum ofimageOffset.xandextent.widthdoes not equal the width of the subresource specified bysrcSubresource,extent.widthmust be a multiple of the texel block extent width of theFormatofsrcImage - For each element of
pRegions, if the sum ofimageOffset.yandextent.heightdoes not equal the height of the subresource specified bysrcSubresource,extent.heightmust be a multiple of the texel block extent height of theFormatofsrcImage - For each element of
pRegions, if the sum ofimageOffset.zandextent.depthdoes not equal the depth of the subresource specified bysrcSubresource,extent.depthmust be a multiple of the texel block extent depth of theFormatofsrcImage - For each
element of
pRegions,imageSubresource.aspectMaskmust specify aspects present insrcImage - If
srcImagehas a multi-planar image format, then for each element ofpRegions,imageSubresource.aspectMaskmust be a single valid multi-planar aspect mask bit - If
srcImageis of typeIMAGE_TYPE_3D, for each element ofpRegions,imageSubresource.baseArrayLayermust be0andimageSubresource.layerCountmust be1 - For each
element of
pRegions,memoryRowLengthmust be a multiple of the texel block extent width of theFormatofsrcImage - For each
element of
pRegions,memoryImageHeightmust be a multiple of the texel block extent height of theFormatofsrcImage - For each
element of
pRegions,memoryRowLengthdivided by the texel block extent width and then multiplied by the texel block size ofsrcImagemust be less than or equal to 231-1 -
srcImageLayoutmust specify the current layout of the image subresources ofsrcImagespecified inpRegions -
srcImageLayoutmust be one of the image layouts returned inPhysicalDeviceHostImageCopyPropertiesEXT::pCopySrcLayouts - If
flagsincludesHOST_IMAGE_COPY_MEMCPY_EXT, for each region inpRegions,memoryRowLengthandmemoryImageHeightmust both be 0
Valid Usage (Implicit)
-
sTypemust beSTRUCTURE_TYPE_COPY_IMAGE_TO_MEMORY_INFO_EXT
-
pNextmust beNULL -
flagsmust be a valid combination ofHostImageCopyFlagBitsEXTvalues -
srcImagemust be a validImagehandle -
srcImageLayoutmust be a validImageLayoutvalue -
pRegionsmust be a valid pointer to an array ofregionCountvalidImageToMemoryCopyEXTstructures -
regionCountmust be greater than0
See Also
VK_EXT_host_image_copy,
HostImageCopyFlagsEXT, Image,
ImageLayout, ImageToMemoryCopyEXT,
StructureType,
copyImageToMemoryEXT
Constructors
| CopyImageToMemoryInfoEXT | |
Fields
| |
Instances
data CopyImageToImageInfoEXT Source #
VkCopyImageToImageInfoEXT - Structure specifying parameters of an image to image host copy command
Description
copyImageToImageEXT does not check whether the device memory
associated with srcImage or dstImage is currently in use before
performing the copy. The application must guarantee that any
previously submitted command that writes to the copy regions has
completed before the host performs the copy.
Valid Usage
- If
srcImageis sparse then all memory ranges accessed by the copy command must be bound as described in Binding Resource Memory - If the stencil
aspect of
srcImageis accessed, andsrcImagewas not created with separate stencil usage,srcImagemust have been created withIMAGE_USAGE_HOST_TRANSFER_BIT_EXTset inImageCreateInfo::usage - If the stencil
aspect of
srcImageis accessed, andsrcImagewas created with separate stencil usage,srcImagemust have been created withIMAGE_USAGE_HOST_TRANSFER_BIT_EXTset inImageStencilUsageCreateInfo::stencilUsage - If non-stencil
aspects of
srcImageare accessed,srcImagemust have been created withIMAGE_USAGE_HOST_TRANSFER_BIT_EXTset inImageCreateInfo::usage - If
flagscontainsHOST_IMAGE_COPY_MEMCPY_EXT, thex,y, andzmembers of thesrcOffsetmember of each element ofpRegionsmust be0 - If
flagscontainsHOST_IMAGE_COPY_MEMCPY_EXT, theextentmember of each element ofpRegionsmust equal the extents ofsrcImageidentified bysrcSubresource - If
srcImageis non-sparse then the image or the specified disjoint plane must be bound completely and contiguously to a singleDeviceMemoryobject - The
srcSubresource.mipLevelmember of each element ofpRegionsmust be less than themipLevelsspecified inImageCreateInfowhensrcImagewas created - If
srcSubresource.layerCountis notREMAINING_ARRAY_LAYERS,srcSubresource.baseArrayLayer+srcSubresource.layerCountof each element ofpRegionsmust be less than or equal to thearrayLayersspecified inImageCreateInfowhensrcImagewas created -
srcImagemust not have been created withflagscontainingIMAGE_CREATE_SUBSAMPLED_BIT_EXT - The image
region specified by each element of
pRegionsmust be contained within the specifiedsrcSubresourceofsrcImage - For each
element of
pRegions,srcOffset.xand (extent.width+srcOffset.x) must both be greater than or equal to0and less than or equal to the width of the specifiedsrcSubresourceofsrcImage - For each
element of
pRegions,srcOffset.yand (extent.height+srcOffset.y) must both be greater than or equal to0and less than or equal to the height of the specifiedsrcSubresourceofsrcImage - If
srcImageis of typeIMAGE_TYPE_1D, then for each element ofpRegions,srcOffset.ymust be0andextent.heightmust be1 - For each element of
pRegions,srcOffset.zand (extent.depth+srcOffset.z) must both be greater than or equal to0and less than or equal to the depth of the specifiedsrcSubresourceofsrcImage - If
srcImageis of typeIMAGE_TYPE_1DorIMAGE_TYPE_2D, then for each element ofpRegions,srcOffset.zmust be0andextent.depthmust be1 - For each element of
pRegions,srcOffset.xmust be a multiple of the texel block extent width of theFormatofsrcImage - For each element of
pRegions,srcOffset.ymust be a multiple of the texel block extent height of theFormatofsrcImage - For each element of
pRegions,srcOffset.zmust be a multiple of the texel block extent depth of theFormatofsrcImage - For each element of
pRegions, if the sum ofsrcOffset.xandextent.widthdoes not equal the width of the subresource specified bysrcSubresource,extent.widthmust be a multiple of the texel block extent width of theFormatofsrcImage - For each element of
pRegions, if the sum ofsrcOffset.yandextent.heightdoes not equal the height of the subresource specified bysrcSubresource,extent.heightmust be a multiple of the texel block extent height of theFormatofsrcImage - For each element of
pRegions, if the sum ofsrcOffset.zandextent.depthdoes not equal the depth of the subresource specified bysrcSubresource,extent.depthmust be a multiple of the texel block extent depth of theFormatofsrcImage - For each
element of
pRegions,srcSubresource.aspectMaskmust specify aspects present insrcImage - If
srcImagehas a multi-planar image format, then for each element ofpRegions,srcSubresource.aspectMaskmust be a single valid multi-planar aspect mask bit - If
srcImageis of typeIMAGE_TYPE_3D, for each element ofpRegions,srcSubresource.baseArrayLayermust be0andsrcSubresource.layerCountmust be1 - If
dstImageis sparse then all memory ranges accessed by the copy command must be bound as described in Binding Resource Memory - If the stencil
aspect of
dstImageis accessed, anddstImagewas not created with separate stencil usage,dstImagemust have been created withIMAGE_USAGE_HOST_TRANSFER_BIT_EXTset inImageCreateInfo::usage - If the stencil
aspect of
dstImageis accessed, anddstImagewas created with separate stencil usage,dstImagemust have been created withIMAGE_USAGE_HOST_TRANSFER_BIT_EXTset inImageStencilUsageCreateInfo::stencilUsage - If non-stencil
aspects of
dstImageare accessed,dstImagemust have been created withIMAGE_USAGE_HOST_TRANSFER_BIT_EXTset inImageCreateInfo::usage - If
flagscontainsHOST_IMAGE_COPY_MEMCPY_EXT, thex,y, andzmembers of thedstOffsetmember of each element ofpRegionsmust be0 - If
flagscontainsHOST_IMAGE_COPY_MEMCPY_EXT, theextentmember of each element ofpRegionsmust equal the extents ofdstImageidentified bydstSubresource - If
dstImageis non-sparse then the image or the specified disjoint plane must be bound completely and contiguously to a singleDeviceMemoryobject - The
dstSubresource.mipLevelmember of each element ofpRegionsmust be less than themipLevelsspecified inImageCreateInfowhendstImagewas created - If
dstSubresource.layerCountis notREMAINING_ARRAY_LAYERS,dstSubresource.baseArrayLayer+dstSubresource.layerCountof each element ofpRegionsmust be less than or equal to thearrayLayersspecified inImageCreateInfowhendstImagewas created -
dstImagemust not have been created withflagscontainingIMAGE_CREATE_SUBSAMPLED_BIT_EXT - The image
region specified by each element of
pRegionsmust be contained within the specifieddstSubresourceofdstImage - For each
element of
pRegions,dstOffset.xand (extent.width+dstOffset.x) must both be greater than or equal to0and less than or equal to the width of the specifieddstSubresourceofdstImage - For each
element of
pRegions,dstOffset.yand (extent.height+dstOffset.y) must both be greater than or equal to0and less than or equal to the height of the specifieddstSubresourceofdstImage - If
dstImageis of typeIMAGE_TYPE_1D, then for each element ofpRegions,dstOffset.ymust be0andextent.heightmust be1 - For each element of
pRegions,dstOffset.zand (extent.depth+dstOffset.z) must both be greater than or equal to0and less than or equal to the depth of the specifieddstSubresourceofdstImage - If
dstImageis of typeIMAGE_TYPE_1DorIMAGE_TYPE_2D, then for each element ofpRegions,dstOffset.zmust be0andextent.depthmust be1 - For each element of
pRegions,dstOffset.xmust be a multiple of the texel block extent width of theFormatofdstImage - For each element of
pRegions,dstOffset.ymust be a multiple of the texel block extent height of theFormatofdstImage - For each element of
pRegions,dstOffset.zmust be a multiple of the texel block extent depth of theFormatofdstImage - For each element of
pRegions, if the sum ofdstOffset.xandextent.widthdoes not equal the width of the subresource specified bysrcSubresource,extent.widthmust be a multiple of the texel block extent width of theFormatofdstImage - For each element of
pRegions, if the sum ofdstOffset.yandextent.heightdoes not equal the height of the subresource specified bysrcSubresource,extent.heightmust be a multiple of the texel block extent height of theFormatofdstImage - For each element of
pRegions, if the sum ofdstOffset.zandextent.depthdoes not equal the depth of the subresource specified bysrcSubresource,extent.depthmust be a multiple of the texel block extent depth of theFormatofdstImage - For each
element of
pRegions,dstSubresource.aspectMaskmust specify aspects present indstImage - If
dstImagehas a multi-planar image format, then for each element ofpRegions,dstSubresource.aspectMaskmust be a single valid multi-planar aspect mask bit - If
dstImageis of typeIMAGE_TYPE_3D, for each element ofpRegions,dstSubresource.baseArrayLayermust be0anddstSubresource.layerCountmust be1 -
srcImageLayoutmust specify the current layout of the image subresources ofsrcImagespecified inpRegions -
dstImageLayoutmust specify the current layout of the image subresources ofdstImagespecified inpRegions -
srcImageLayoutmust be one of the image layouts returned inPhysicalDeviceHostImageCopyPropertiesEXT::pCopySrcLayouts -
dstImageLayoutmust be one of the image layouts returned inPhysicalDeviceHostImageCopyPropertiesEXT::pCopyDstLayouts
Valid Usage (Implicit)
-
sTypemust beSTRUCTURE_TYPE_COPY_IMAGE_TO_IMAGE_INFO_EXT
-
pNextmust beNULL -
flagsmust be a valid combination ofHostImageCopyFlagBitsEXTvalues -
srcImagemust be a validImagehandle -
srcImageLayoutmust be a validImageLayoutvalue -
dstImagemust be a validImagehandle -
dstImageLayoutmust be a validImageLayoutvalue -
pRegionsmust be a valid pointer to an array ofregionCountvalidImageCopy2structures -
regionCountmust be greater than0 - Both of
dstImage, andsrcImagemust have been created, allocated, or retrieved from the sameDevice
See Also
VK_EXT_host_image_copy,
HostImageCopyFlagsEXT, Image,
ImageCopy2,
ImageLayout,
StructureType, copyImageToImageEXT
Constructors
| CopyImageToImageInfoEXT | |
Fields
| |
Instances
| Show CopyImageToImageInfoEXT Source # | |
Defined in Vulkan.Extensions.VK_EXT_host_image_copy Methods showsPrec :: Int -> CopyImageToImageInfoEXT -> ShowS # show :: CopyImageToImageInfoEXT -> String # showList :: [CopyImageToImageInfoEXT] -> ShowS # | |
| FromCStruct CopyImageToImageInfoEXT Source # | |
Defined in Vulkan.Extensions.VK_EXT_host_image_copy Methods peekCStruct :: Ptr CopyImageToImageInfoEXT -> IO CopyImageToImageInfoEXT Source # | |
| ToCStruct CopyImageToImageInfoEXT Source # | |
Defined in Vulkan.Extensions.VK_EXT_host_image_copy Methods withCStruct :: CopyImageToImageInfoEXT -> (Ptr CopyImageToImageInfoEXT -> IO b) -> IO b Source # pokeCStruct :: Ptr CopyImageToImageInfoEXT -> CopyImageToImageInfoEXT -> IO b -> IO b Source # withZeroCStruct :: (Ptr CopyImageToImageInfoEXT -> IO b) -> IO b Source # pokeZeroCStruct :: Ptr CopyImageToImageInfoEXT -> IO b -> IO b Source # cStructSize :: Int Source # | |
| Zero CopyImageToImageInfoEXT Source # | |
Defined in Vulkan.Extensions.VK_EXT_host_image_copy Methods | |
data HostImageLayoutTransitionInfoEXT Source #
VkHostImageLayoutTransitionInfoEXT - Structure specifying the parameters of a host-side image layout transition
Description
transitionImageLayoutEXT does not check whether the device memory
associated with an image is currently in use before performing the
layout transition. The application must guarantee that any previously
submitted command that reads from or writes to this subresource has
completed before the host performs the layout transition.
Note
Image layout transitions performed on the host do not require queue family ownership transfers as the physical layout of the image will not vary between queue families for the layouts supported by this function.
Valid Usage
-
imagemust have been created withIMAGE_USAGE_HOST_TRANSFER_BIT_EXT
-
subresourceRange.baseMipLevelmust be less than themipLevelsspecified inImageCreateInfowhenimagewas created - If
subresourceRange.levelCountis notREMAINING_MIP_LEVELS,subresourceRange.baseMipLevel+subresourceRange.levelCountmust be less than or equal to themipLevelsspecified inImageCreateInfowhenimagewas created -
subresourceRange.baseArrayLayermust be less than thearrayLayersspecified inImageCreateInfowhenimagewas created - If
subresourceRange.layerCountis notREMAINING_ARRAY_LAYERS,subresourceRange.baseArrayLayer+subresourceRange.layerCountmust be less than or equal to thearrayLayersspecified inImageCreateInfowhenimagewas created - If
imageis non-sparse then it must be bound completely and contiguously to a singleDeviceMemoryobject - If
imagehas a color format that is single-plane, then theaspectMaskmember ofsubresourceRangemust beIMAGE_ASPECT_COLOR_BIT - If
imagehas a color format and is not disjoint, then theaspectMaskmember ofsubresourceRangemust beIMAGE_ASPECT_COLOR_BIT - If
imagehas a multi-planar format and the image is disjoint, then theaspectMaskmember ofsubresourceRangemust include at least one multi-planar aspect mask bit orIMAGE_ASPECT_COLOR_BIT - If
imagehas a depth/stencil format with both depth and stencil and the separateDepthStencilLayouts feature is enabled, then theaspectMaskmember ofsubresourceRangemust include either or bothIMAGE_ASPECT_DEPTH_BITandIMAGE_ASPECT_STENCIL_BIT - If
imagehas a depth/stencil format with both depth and stencil and the separateDepthStencilLayouts feature is not enabled, then theaspectMaskmember ofsubresourceRangemust include bothIMAGE_ASPECT_DEPTH_BITandIMAGE_ASPECT_STENCIL_BIT - If the
aspectMaskmember ofsubresourceRangeincludesIMAGE_ASPECT_DEPTH_BIT,oldLayoutandnewLayoutmust not be one ofIMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMALorIMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL - If the
aspectMaskmember ofsubresourceRangeincludesIMAGE_ASPECT_STENCIL_BIT,oldLayoutandnewLayoutmust not be one ofIMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMALorIMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL -
oldLayoutmust be eitherIMAGE_LAYOUT_UNDEFINEDor the current layout of the image subresources as specified insubresourceRange - If
oldLayoutis notIMAGE_LAYOUT_UNDEFINEDorIMAGE_LAYOUT_PREINITIALIZED, it must be one of the layouts inPhysicalDeviceHostImageCopyPropertiesEXT::pCopySrcLayouts -
newLayoutmust be one of the layouts inPhysicalDeviceHostImageCopyPropertiesEXT::pCopyDstLayouts
Valid Usage (Implicit)
-
sTypemust beSTRUCTURE_TYPE_HOST_IMAGE_LAYOUT_TRANSITION_INFO_EXT
-
pNextmust beNULL -
imagemust be a validImagehandle -
oldLayoutmust be a validImageLayoutvalue -
newLayoutmust be a validImageLayoutvalue -
subresourceRangemust be a validImageSubresourceRangestructure
See Also
VK_EXT_host_image_copy,
Image,
ImageLayout,
ImageSubresourceRange,
StructureType,
transitionImageLayoutEXT
Constructors
| HostImageLayoutTransitionInfoEXT | |
Fields
| |
Instances
data SubresourceHostMemcpySizeEXT Source #
VkSubresourceHostMemcpySizeEXT - Memory size needed to copy to or from an image on the host with VK_HOST_IMAGE_COPY_MEMCPY_EXT
Valid Usage (Implicit)
See Also
Constructors
| SubresourceHostMemcpySizeEXT | |
Fields
| |
Instances
data HostImageCopyDevicePerformanceQueryEXT Source #
VkHostImageCopyDevicePerformanceQueryEXT - Struct containing information about optimality of device access
Description
The implementation may return FALSE
in optimalDeviceAccess if identicalMemoryLayout is
FALSE. If identicalMemoryLayout is
TRUE, optimalDeviceAccess must be
TRUE.
The implementation may return TRUE in
optimalDeviceAccess while identicalMemoryLayout is
FALSE. In this situation, any device
performance impact should not be measurable.
If
PhysicalDeviceImageFormatInfo2::format
is a block-compressed format and
getPhysicalDeviceImageFormatProperties2
returns SUCCESS, the implementation must
return TRUE in optimalDeviceAccess.
Note
Applications can make use of optimalDeviceAccess to determine their
resource copying strategy. If a resource is expected to be accessed more
on device than on the host, and the implementation considers the
resource sub-optimally accessed, it is likely better to use device
copies instead.
Note
Layout not being identical yet still considered optimal for device access could happen if the implementation has different memory layout patterns, some of which are easier to access on the host.
Note
The most practical reason for optimalDeviceAccess to be
FALSE is that host image access may
disable framebuffer compression where it would otherwise have been
enabled. This represents far more efficient host image access since no
compression algorithm is required to read or write to the image, but it
would impact device access performance. Some implementations may only
set optimalDeviceAccess to FALSE if
certain conditions are met, such as specific image usage flags or
creation flags.
Valid Usage (Implicit)
See Also
Constructors
| HostImageCopyDevicePerformanceQueryEXT | |
Fields
| |
Instances
newtype HostImageCopyFlagBitsEXT Source #
VkHostImageCopyFlagBitsEXT - Bitmask specifying additional copy parameters
See Also
Constructors
| HostImageCopyFlagBitsEXT Flags |
Bundled Patterns
| pattern HOST_IMAGE_COPY_MEMCPY_EXT :: HostImageCopyFlagBitsEXT |
|
Instances
type EXT_HOST_IMAGE_COPY_SPEC_VERSION = 1 Source #
pattern EXT_HOST_IMAGE_COPY_SPEC_VERSION :: forall a. Integral a => a Source #
type EXT_HOST_IMAGE_COPY_EXTENSION_NAME = "VK_EXT_host_image_copy" Source #
pattern EXT_HOST_IMAGE_COPY_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a Source #
data ImageSubresource2KHR Source #
VkImageSubresource2KHR - Structure specifying an image subresource
Valid Usage (Implicit)
See Also
VK_EXT_host_image_copy,
VK_EXT_image_compression_control,
VK_KHR_maintenance5,
DeviceImageSubresourceInfoKHR,
ImageSubresource,
StructureType,
getImageSubresourceLayout2EXT,
getImageSubresourceLayout2KHR
Constructors
| ImageSubresource2KHR | |
Fields
| |
Instances
data SubresourceLayout2KHR (es :: [Type]) Source #
VkSubresourceLayout2KHR - Structure specifying subresource layout
Valid Usage (Implicit)
-
sTypemust beSTRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2_KHR
- Each
pNextmember of any structure (including this one) in thepNextchain must be eitherNULLor a pointer to a valid instance ofImageCompressionPropertiesEXTorSubresourceHostMemcpySizeEXT - The
sTypevalue of each struct in thepNextchain must be unique
See Also
VK_EXT_host_image_copy,
VK_EXT_image_compression_control,
VK_KHR_maintenance5,
StructureType,
SubresourceLayout,
getDeviceImageSubresourceLayoutKHR,
getImageSubresourceLayout2EXT,
getImageSubresourceLayout2KHR
Constructors
| SubresourceLayout2KHR | |
Fields
| |
Instances
getImageSubresourceLayout2KHR Source #
Arguments
| :: forall a io. (Extendss SubresourceLayout2KHR a, PokeChain a, PeekChain a, MonadIO io) | |
| => Device |
|
| -> Image |
|
| -> ImageSubresource2KHR |
|
| -> io (SubresourceLayout2KHR a) |
vkGetImageSubresourceLayout2KHR - Retrieve information about an image subresource
Description
getImageSubresourceLayout2KHR behaves similarly to
getImageSubresourceLayout, with the ability to
specify extended inputs via chained input structures, and to return
extended information via chained output structures.
It is legal to call getImageSubresourceLayout2KHR with a image
created with tiling equal to
IMAGE_TILING_OPTIMAL, but the members
of SubresourceLayout2KHR::subresourceLayout will have undefined
values in this case.
Note
Structures chained from ImageSubresource2KHR::pNext will also be
updated when tiling is equal to
IMAGE_TILING_OPTIMAL.
Valid Usage
- The
mipLevelmember ofpSubresourcemust be less than themipLevelsspecified inImageCreateInfowhenimagewas created - The
arrayLayermember ofpSubresourcemust be less than thearrayLayersspecified inImageCreateInfowhenimagewas created - If
formatof theimageis a color format,tilingof theimageisIMAGE_TILING_LINEARorIMAGE_TILING_OPTIMAL, and does not have a multi-planar image format, theaspectMaskmember ofpSubresourcemust beIMAGE_ASPECT_COLOR_BIT - If
formatof theimagehas a depth component, theaspectMaskmember ofpSubresourcemust containIMAGE_ASPECT_DEPTH_BIT - If
formatof theimagehas a stencil component, theaspectMaskmember ofpSubresourcemust containIMAGE_ASPECT_STENCIL_BIT - If
formatof theimagedoes not contain a stencil or depth component, theaspectMaskmember ofpSubresourcemust not containIMAGE_ASPECT_DEPTH_BITorIMAGE_ASPECT_STENCIL_BIT - If the
tilingof theimageisIMAGE_TILING_LINEARand has a multi-planar image format, then theaspectMaskmember ofpSubresourcemust be a single valid multi-planar aspect mask bit - If
imagewas created with theEXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROIDexternal memory handle type, thenimagemust be bound to memory - If the
tilingof theimageisIMAGE_TILING_DRM_FORMAT_MODIFIER_EXT, then theaspectMaskmember ofpSubresourcemust beVK_IMAGE_ASPECT_MEMORY_PLANE_i_BIT_EXTand the index i must be less than theDrmFormatModifierPropertiesEXT::drmFormatModifierPlaneCountassociated with the image’sformatandImageDrmFormatModifierPropertiesEXT::drmFormatModifier
Valid Usage (Implicit)
-
devicemust be a validDevicehandle
-
imagemust be a validImagehandle -
pSubresourcemust be a valid pointer to a validImageSubresource2KHRstructure -
pLayoutmust be a valid pointer to aSubresourceLayout2KHRstructure -
imagemust have been created, allocated, or retrieved fromdevice
See Also
VK_KHR_maintenance5,
Device, Image,
ImageSubresource2KHR, SubresourceLayout2KHR