Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype VkImageLayout = VkImageLayout Int32
- pattern VK_IMAGE_LAYOUT_UNDEFINED :: VkImageLayout
- pattern VK_IMAGE_LAYOUT_GENERAL :: VkImageLayout
- pattern VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL :: VkImageLayout
- pattern VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL :: VkImageLayout
- pattern VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL :: VkImageLayout
- pattern VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL :: VkImageLayout
- pattern VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL :: VkImageLayout
- pattern VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL :: VkImageLayout
- pattern VK_IMAGE_LAYOUT_PREINITIALIZED :: VkImageLayout
- vkCreateImage :: ("device" ::: VkDevice) -> ("pCreateInfo" ::: Ptr VkImageCreateInfo) -> ("pAllocator" ::: Ptr VkAllocationCallbacks) -> ("pImage" ::: Ptr VkImage) -> IO VkResult
- vkDestroyImage :: ("device" ::: VkDevice) -> ("image" ::: VkImage) -> ("pAllocator" ::: Ptr VkAllocationCallbacks) -> IO ()
- vkGetImageSubresourceLayout :: ("device" ::: VkDevice) -> ("image" ::: VkImage) -> ("pSubresource" ::: Ptr VkImageSubresource) -> ("pLayout" ::: Ptr VkSubresourceLayout) -> IO ()
- data VkImageCreateInfo = VkImageCreateInfo {
- vkSType :: VkStructureType
- vkPNext :: Ptr ()
- vkFlags :: VkImageCreateFlags
- vkImageType :: VkImageType
- vkFormat :: VkFormat
- vkExtent :: VkExtent3D
- vkMipLevels :: Word32
- vkArrayLayers :: Word32
- vkSamples :: VkSampleCountFlagBits
- vkTiling :: VkImageTiling
- vkUsage :: VkImageUsageFlags
- vkSharingMode :: VkSharingMode
- vkQueueFamilyIndexCount :: Word32
- vkPQueueFamilyIndices :: Ptr Word32
- vkInitialLayout :: VkImageLayout
- data VkSubresourceLayout = VkSubresourceLayout {}
Documentation
newtype VkImageLayout Source #
VkImageLayout - Layout of image and image subresources
Description
The type(s) of device access supported by each layout are:
VK_IMAGE_LAYOUT_UNDEFINED
does not support device access. This layout must only be used as theinitialLayout
member ofVkImageCreateInfo
orVkAttachmentDescription
, or as theoldLayout
in an image transition. When transitioning out of this layout, the contents of the memory are not guaranteed to be preserved.VK_IMAGE_LAYOUT_PREINITIALIZED
does not support device access. This layout must only be used as theinitialLayout
member ofVkImageCreateInfo
orVkAttachmentDescription
, or as theoldLayout
in an image transition. When transitioning out of this layout, the contents of the memory are preserved. This layout is intended to be used as the initial layout for an image whose contents are written by the host, and hence the data can be written to memory immediately, without first executing a layout transition. Currently,VK_IMAGE_LAYOUT_PREINITIALIZED
is only useful withVK_IMAGE_TILING_LINEAR
images because there is not a standard layout defined forVK_IMAGE_TILING_OPTIMAL
images.VK_IMAGE_LAYOUT_GENERAL
supports all types of device access.VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
must only be used as a color or resolve attachment in aVkFramebuffer
. This layout is valid only for image subresources of images created with theVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
usage bit enabled.VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL
must only be used as a depth/stencil attachment in aVkFramebuffer
. This layout is valid only for image subresources of images created with theVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
usage bit enabled.VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
must only be used as a read-only depth/stencil attachment in aVkFramebuffer
and/or as a read-only image in a shader (which can be read as a sampled image, combined image/sampler and/or input attachment). This layout is valid only for image subresources of images created with theVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
usage bit enabled. Only image subresources of images created withVK_IMAGE_USAGE_SAMPLED_BIT
can be used as a sampled image or combined image/sampler in a shader. Similarly, only image subresources of images created withVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT
can be used as input attachments.VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL
: must only be used as a depth/stencil attachment in aVkFramebuffer
, where the depth aspect is read-only, and/or as a read-only image in a shader (which can be read as a sampled image, combined image/sampler and/or input attachment) where only the depth aspect is accessed. This layout is valid only for image subresources of images created with theVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
usage bit enabled. Only image subresources of images created withVK_IMAGE_USAGE_SAMPLED_BIT
can be used as a sampled image or combined image/sampler in a shader. Similarly, only image subresources of images created withVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT
can be used as input attachments.VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL
: must only be used as a depth/stencil attachment in aVkFramebuffer
, where the stencil aspect is read-only, and/or as a read-only image in a shader (which can be read as a sampled image, combined image/sampler and/or input attachment) where only the stencil aspect is accessed. This layout is valid only for image subresources of images created with theVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
usage bit enabled. Only image subresources of images created withVK_IMAGE_USAGE_SAMPLED_BIT
can be used as a sampled image or combined image/sampler in a shader. Similarly, only image subresources of images created withVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT
can be used as input attachments.VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
must only be used as a read-only image in a shader (which can be read as a sampled image, combined image/sampler and/or input attachment). This layout is valid only for image subresources of images created with theVK_IMAGE_USAGE_SAMPLED_BIT
orVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT
usage bit enabled.VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL
must only be used as a source image of a transfer command (see the definition of @VK_PIPELINE_STAGE_TRANSFER_BIT@). This layout is valid only for image subresources of images created with theVK_IMAGE_USAGE_TRANSFER_SRC_BIT
usage bit enabled.VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL
must only be used as a destination image of a transfer command. This layout is valid only for image subresources of images created with theVK_IMAGE_USAGE_TRANSFER_DST_BIT
usage bit enabled.VK_IMAGE_LAYOUT_PRESENT_SRC_KHR
must only be used for presenting a presentable image for display. A swapchain’s image must be transitioned to this layout before callingvkQueuePresentKHR
, and must be transitioned away from this layout after callingvkAcquireNextImageKHR
.VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR
is valid only for shared presentable images, and must be used for any usage the image supports.
The layout of each image subresource is not a state of the image
subresource itself, but is rather a property of how the data in memory
is organized, and thus for each mechanism of accessing an image in the
API the application must specify a parameter or structure member that
indicates which image layout the image subresource(s) are considered to
be in when the image will be accessed. For transfer commands, this is a
parameter to the command (see
{html_spec_relative}#clears
and
{html_spec_relative}#copies).
For use as a framebuffer attachment, this is a member in the
substructures of the VkRenderPassCreateInfo
(see Render
Pass).
For use in a descriptor set, this is a member in the
VkDescriptorImageInfo
structure (see
{html_spec_relative}#descriptorsets-updates).
At the time that any command buffer command accessing an image executes
on any queue, the layouts of the image subresources that are accessed
must all match the layout specified via the API controlling those
accesses.
When performing a layout transition on an image subresource, the old
layout value must either equal the current layout of the image
subresource (at the time the transition executes), or else be
VK_IMAGE_LAYOUT_UNDEFINED
(implying that the contents of the image
subresource need not be preserved). The new layout used in a transition
must not be VK_IMAGE_LAYOUT_UNDEFINED
or
VK_IMAGE_LAYOUT_PREINITIALIZED
.
The image layout of each image subresource of a depth/stencil image
created with VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT
is dependent on the last sample locations used to render to the image
subresource as a depth/stencil attachment, thus applications must
provide the same sample locations that were last used to render to the
given image subresource whenever a layout transition of the image
subresource happens, otherwise the contents of the depth aspect of the
image subresource become undefined.
In addition, depth reads from a depth/stencil attachment referring to
an image subresource range of a depth/stencil image created with
VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT
using
different sample locations than what have been last used to perform
depth writes to the image subresources of the same image subresource
range produce undefined results.
Similarly, depth writes to a depth/stencil attachment referring to an
image subresource range of a depth/stencil image created with
VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT
using
different sample locations than what have been last used to perform
depth writes to the image subresources of the same image subresource
range make the contents of the depth aspect of those image subresources
undefined.
See Also
VkAttachmentDescription
,
VkAttachmentReference
,
VkDescriptorImageInfo
,
VkImageCreateInfo
,
VkImageMemoryBarrier
,
vkCmdBlitImage
,
vkCmdClearColorImage
,
vkCmdClearDepthStencilImage
,
vkCmdCopyBufferToImage
,
vkCmdCopyImage
,
vkCmdCopyImageToBuffer
,
vkCmdResolveImage
Instances
pattern VK_IMAGE_LAYOUT_UNDEFINED :: VkImageLayout Source #
pattern VK_IMAGE_LAYOUT_GENERAL :: VkImageLayout Source #
pattern VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL :: VkImageLayout Source #
pattern VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL :: VkImageLayout Source #
pattern VK_IMAGE_LAYOUT_PREINITIALIZED :: VkImageLayout Source #
vkCreateImage :: ("device" ::: VkDevice) -> ("pCreateInfo" ::: Ptr VkImageCreateInfo) -> ("pAllocator" ::: Ptr VkAllocationCallbacks) -> ("pImage" ::: Ptr VkImage) -> IO VkResult Source #
vkCreateImage - Create a new image object
Parameters
device
is the logical device that creates the image.
pCreateInfo
is a pointer to an instance of theVkImageCreateInfo
structure containing parameters to be used to create the image.pAllocator
controls host memory allocation as described in the Memory Allocation chapter.pImage
points to aVkImage
handle in which the resulting image object is returned.
Valid Usage
- If the
flags
member ofpCreateInfo
includesVK_IMAGE_CREATE_SPARSE_BINDING_BIT
, creating thisVkImage
must not cause the total required sparse memory for all currently valid sparse resources on the device to exceedVkPhysicalDeviceLimits
::sparseAddressSpaceSize
Valid Usage (Implicit)
device
must be a validVkDevice
handle
pCreateInfo
must be a valid pointer to a validVkImageCreateInfo
structure- If
pAllocator
is notNULL
,pAllocator
must be a valid pointer to a validVkAllocationCallbacks
structure pImage
must be a valid pointer to aVkImage
handle
Return Codes
[Success]
- VK_SUCCESS
[Failure]
- VK_ERROR_OUT_OF_HOST_MEMORY
VK_ERROR_OUT_OF_DEVICE_MEMORY
See Also
vkDestroyImage :: ("device" ::: VkDevice) -> ("image" ::: VkImage) -> ("pAllocator" ::: Ptr VkAllocationCallbacks) -> IO () Source #
vkDestroyImage - Destroy an image object
Parameters
device
is the logical device that destroys the image.
image
is the image to destroy.pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
Valid Usage
- All submitted commands that refer to
image
, either directly or via aVkImageView
, must have completed execution
- If
VkAllocationCallbacks
were provided whenimage
was created, a compatible set of callbacks must be provided here - If no
VkAllocationCallbacks
were provided whenimage
was created,pAllocator
must beNULL
Valid Usage (Implicit)
device
must be a validVkDevice
handle
- If
image
is notVK_NULL_HANDLE
,image
must be a validVkImage
handle - If
pAllocator
is notNULL
,pAllocator
must be a valid pointer to a validVkAllocationCallbacks
structure - If
image
is a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
image
must be externally synchronized
See Also
vkGetImageSubresourceLayout :: ("device" ::: VkDevice) -> ("image" ::: VkImage) -> ("pSubresource" ::: Ptr VkImageSubresource) -> ("pLayout" ::: Ptr VkSubresourceLayout) -> IO () Source #
vkGetImageSubresourceLayout - Retrieve information about an image subresource
Parameters
device
is the logical device that owns the image.
image
is the image whose layout is being queried.pSubresource
is a pointer to aVkImageSubresource
structure selecting a specific image for the image subresource.pLayout
points to aVkSubresourceLayout
structure in which the layout is returned.
Description
If the VkFormat
of image
is a
multi-planar
format,
vkGetImageSubresourceLayout
describes one plane of the image.
vkGetImageSubresourceLayout
is invariant for the lifetime of a single
image. However, the subresource layout of images in Android hardware
buffer external memory isn’t known until the image has been bound to
memory, so calling vkGetImageSubresourceLayout
for such an image
before it has been bound will result in undefined behavior.
Valid Usage
image
must have been created withtiling
equal toVK_IMAGE_TILING_LINEAR
- The
aspectMask
member ofpSubresource
must only have a single bit set - The
mipLevel
member ofpSubresource
must be less than themipLevels
specified inVkImageCreateInfo
whenimage
was created - The
arrayLayer
member ofpSubresource
must be less than thearrayLayers
specified inVkImageCreateInfo
whenimage
was created - If the
format
ofimage
is a multi-planar format with two planes, theaspectMask
member ofpSubresource
must beVK_IMAGE_ASPECT_PLANE_0_BIT
orVK_IMAGE_ASPECT_PLANE_1_BIT
- If the
format
ofimage
is a multi-planar format with three planes, theaspectMask
member ofpSubresource
must beVK_IMAGE_ASPECT_PLANE_0_BIT
,VK_IMAGE_ASPECT_PLANE_1_BIT
orVK_IMAGE_ASPECT_PLANE_2_BIT
- If
image
was created with the VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID external memory handle type, thenimage
must be bound to memory.
Valid Usage (Implicit)
device
must be a validVkDevice
handle
image
must be a validVkImage
handlepSubresource
must be a valid pointer to a validVkImageSubresource
structurepLayout
must be a valid pointer to aVkSubresourceLayout
structureimage
must have been created, allocated, or retrieved fromdevice
See Also
data VkImageCreateInfo Source #
VkImageCreateInfo - Structure specifying the parameters of a newly created image object
Description
Images created with tiling
equal to VK_IMAGE_TILING_LINEAR
have
further restrictions on their limits and capabilities compared to images
created with tiling
equal to VK_IMAGE_TILING_OPTIMAL
. Creation of
images with tiling VK_IMAGE_TILING_LINEAR
may not be supported
unless other parameters meet all of the constraints:
imageType
isVK_IMAGE_TYPE_2D
format
is not a depth/stencil formatmipLevels
is 1arrayLayers
is 1samples
isVK_SAMPLE_COUNT_1_BIT
usage
only includesVK_IMAGE_USAGE_TRANSFER_SRC_BIT
and/orVK_IMAGE_USAGE_TRANSFER_DST_BIT
Implementations may support additional limits and capabilities beyond those listed above.
To query an implementation’s specific capabilities for a given
combination of format
, imageType
, tiling
, usage
,
VkExternalMemoryImageCreateInfo
::handleTypes
and flags
, call
vkGetPhysicalDeviceImageFormatProperties2
.
The return value specifies whether that combination of image settings is
supported. On success, the VkImageFormatProperties
output parameter
specifies the set of valid samples
bits and the limits for extent
,
mipLevels
, arrayLayers
, and maxResourceSize
. Even if
vkGetPhysicalDeviceImageFormatProperties2
.
returns success and the parameters to vkCreateImage are all within the
returned limits, vkCreateImage
must fail and return
VK_ERROR_OUT_OF_DEVICE_MEMORY
if the resulting size of the image would
be larger than maxResourceSize
.
To determine the set of valid usage
bits for a given format, call
vkGetPhysicalDeviceFormatProperties
.
Note
For images created without VK_IMAGE_CREATE_EXTENDED_USAGE_BIT
a
usage
bit is valid if it is supported for the format the image is
created with.
For images created with VK_IMAGE_CREATE_EXTENDED_USAGE_BIT
a usage
bit is valid if it is supported for at least one of the formats a
VkImageView
created from the image can have (see Image
Views
for more detail).
Valid Usage
- If the
pNext
chain doesn’t contain an instance ofVkExternalFormatANDROID
, or ifformat
is not VK_FORMAT_UNDEFINED, the combination offormat
,imageType
,tiling
,usage
, andflags
must be supported, as indicated by aVK_SUCCESS
return value fromvkGetPhysicalDeviceImageFormatProperties
invoked with the same values passed to the corresponding parameters.
- If
sharingMode
isVK_SHARING_MODE_CONCURRENT
,pQueueFamilyIndices
must be a valid pointer to an array ofqueueFamilyIndexCount
uint32_t
values - If
sharingMode
isVK_SHARING_MODE_CONCURRENT
,queueFamilyIndexCount
must be greater than1
- If
sharingMode
isVK_SHARING_MODE_CONCURRENT
, each element ofpQueueFamilyIndices
must be unique and must be less thanpQueueFamilyPropertyCount
returned by eithervkGetPhysicalDeviceQueueFamilyProperties
orvkGetPhysicalDeviceQueueFamilyProperties2
for thephysicalDevice
that was used to createdevice
format
must not beVK_FORMAT_UNDEFINED
extent
::width
must be greater than0
.extent
::height
must be greater than0
.extent
::depth
must be greater than0
.mipLevels
must be greater than0
arrayLayers
must be greater than0
- If
flags
containsVK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT
,imageType
must beVK_IMAGE_TYPE_2D
- If
flags
containsVK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT
,imageType
must beVK_IMAGE_TYPE_3D
- If
imageType
isVK_IMAGE_TYPE_1D
,extent.width
must be less than or equal toVkPhysicalDeviceLimits
::maxImageDimension1D
, orVkImageFormatProperties
::maxExtent.width
(as returned byvkGetPhysicalDeviceImageFormatProperties
withformat
,imageType
,tiling
,usage
, andflags
equal to those in this structure) - whichever is higher - If
imageType
isVK_IMAGE_TYPE_2D
andflags
does not containVK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT
,extent.width
andextent.height
must be less than or equal toVkPhysicalDeviceLimits
::maxImageDimension2D
, orVkImageFormatProperties
::maxExtent.width
/height
(as returned byvkGetPhysicalDeviceImageFormatProperties
withformat
,imageType
,tiling
,usage
, andflags
equal to those in this structure) - whichever is higher - If
imageType
isVK_IMAGE_TYPE_2D
andflags
containsVK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT
,extent.width
andextent.height
must be less than or equal toVkPhysicalDeviceLimits
::maxImageDimensionCube
, orVkImageFormatProperties
::maxExtent.width
/height
(as returned byvkGetPhysicalDeviceImageFormatProperties
withformat
,imageType
,tiling
,usage
, andflags
equal to those in this structure) - whichever is higher - If
imageType
isVK_IMAGE_TYPE_2D
andflags
containsVK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT
,extent.width
andextent.height
must be equal andarrayLayers
must be greater than or equal to 6 - If
imageType
isVK_IMAGE_TYPE_3D
,extent.width
,extent.height
andextent.depth
must be less than or equal toVkPhysicalDeviceLimits
::maxImageDimension3D
, orVkImageFormatProperties
::maxExtent.width
/height
/depth
(as returned byvkGetPhysicalDeviceImageFormatProperties
withformat
,imageType
,tiling
,usage
, andflags
equal to those in this structure) - whichever is higher - If
imageType
isVK_IMAGE_TYPE_1D
, bothextent.height
andextent.depth
must be1
- If
imageType
isVK_IMAGE_TYPE_2D
,extent.depth
must be1
mipLevels
must be less than or equal to ⌊log2(max(extent.width
,extent.height
,extent.depth
))⌋ + 1.mipLevels
must be less than or equal toVkImageFormatProperties
::maxMipLevels
(as returned byvkGetPhysicalDeviceImageFormatProperties
withformat
,imageType
,tiling
,usage
, andflags
equal to those in this structure)arrayLayers
must be less than or equal toVkImageFormatProperties
::maxArrayLayers
(as returned byvkGetPhysicalDeviceImageFormatProperties
withformat
,imageType
,tiling
,usage
, andflags
equal to those in this structure)- If
imageType
isVK_IMAGE_TYPE_3D
,arrayLayers
must be1
. - If
samples
is notVK_SAMPLE_COUNT_1_BIT
,imageType
must beVK_IMAGE_TYPE_2D
,flags
must not containVK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT
,tiling
must beVK_IMAGE_TILING_OPTIMAL
, andmipLevels
must be equal to1
- If
usage
includesVK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT
, then bits other thanVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
,VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
, andVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT
must not be set - If
usage
includesVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
,VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
,VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT
, orVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT
,extent.width
must be less than or equal toVkPhysicalDeviceLimits
::maxFramebufferWidth
- If
usage
includesVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
,VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
,VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT
, orVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT
,extent.height
must be less than or equal toVkPhysicalDeviceLimits
::maxFramebufferHeight
- If
usage
includesVK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT
,usage
must also contain at least one ofVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
,VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
, orVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT
. samples
must be a bit value that is set inVkImageFormatProperties
::sampleCounts
returned byvkGetPhysicalDeviceImageFormatProperties
withformat
,imageType
,tiling
,usage
, andflags
equal to those in this structure- If the multisampled storage
images
feature is not enabled, and
usage
containsVK_IMAGE_USAGE_STORAGE_BIT
,samples
must beVK_SAMPLE_COUNT_1_BIT
- If the sparse
bindings
feature is not enabled,
flags
must not containVK_IMAGE_CREATE_SPARSE_BINDING_BIT
- If the sparse aliased
residency
feature is not enabled,
flags
must not containVK_IMAGE_CREATE_SPARSE_ALIASED_BIT
- If
imageType
isVK_IMAGE_TYPE_1D
,flags
must not containVK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
- If the sparse residency for 2D
images
feature is not enabled, and
imageType
isVK_IMAGE_TYPE_2D
,flags
must not containVK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
- If the sparse residency for 3D
images
feature is not enabled, and
imageType
isVK_IMAGE_TYPE_3D
,flags
must not containVK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
- If the sparse residency for images with 2
samples
feature is not enabled,
imageType
isVK_IMAGE_TYPE_2D
, andsamples
isVK_SAMPLE_COUNT_2_BIT
,flags
must not containVK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
- If the sparse residency for images with 4
samples
feature is not enabled,
imageType
isVK_IMAGE_TYPE_2D
, andsamples
isVK_SAMPLE_COUNT_4_BIT
,flags
must not containVK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
- If the sparse residency for images with 8
samples
feature is not enabled,
imageType
isVK_IMAGE_TYPE_2D
, andsamples
isVK_SAMPLE_COUNT_8_BIT
,flags
must not containVK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
- If the sparse residency for images with 16
samples
feature is not enabled,
imageType
isVK_IMAGE_TYPE_2D
, andsamples
isVK_SAMPLE_COUNT_16_BIT
,flags
must not containVK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
- If
tiling
isVK_IMAGE_TILING_LINEAR
,format
must be a format that has at least one supported feature bit present in the value ofVkFormatProperties
::linearTilingFeatures
returned byvkGetPhysicalDeviceFormatProperties
with the same value offormat
- If
tiling
isVK_IMAGE_TILING_LINEAR
, andVkFormatProperties
::linearTilingFeatures
(as returned byvkGetPhysicalDeviceFormatProperties
with the same value offormat
) does not includeVK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT
,usage
must not containVK_IMAGE_USAGE_SAMPLED_BIT
- If
tiling
isVK_IMAGE_TILING_LINEAR
, andVkFormatProperties
::linearTilingFeatures
(as returned byvkGetPhysicalDeviceFormatProperties
with the same value offormat
) does not includeVK_FORMAT_FEATURE_STORAGE_IMAGE_BIT
,usage
must not containVK_IMAGE_USAGE_STORAGE_BIT
- If
tiling
isVK_IMAGE_TILING_LINEAR
, andVkFormatProperties
::linearTilingFeatures
(as returned byvkGetPhysicalDeviceFormatProperties
with the same value offormat
) does not includeVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT
,usage
must not containVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
- If
tiling
isVK_IMAGE_TILING_LINEAR
, andVkFormatProperties
::linearTilingFeatures
(as returned byvkGetPhysicalDeviceFormatProperties
with the same value offormat
) does not includeVK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT
,usage
must not containVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
- If
tiling
isVK_IMAGE_TILING_OPTIMAL
,format
must be a format that has at least one supported feature bit present in the value ofVkFormatProperties
::optimalTilingFeatures
returned byvkGetPhysicalDeviceFormatProperties
with the same value offormat
- If
tiling
isVK_IMAGE_TILING_OPTIMAL
, andVkFormatProperties
::optimalTilingFeatures
(as returned byvkGetPhysicalDeviceFormatProperties
with the same value offormat
) does not includeVK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT
,usage
must not containVK_IMAGE_USAGE_SAMPLED_BIT
- If
tiling
isVK_IMAGE_TILING_OPTIMAL
, andVkFormatProperties
::optimalTilingFeatures
(as returned byvkGetPhysicalDeviceFormatProperties
with the same value offormat
) does not includeVK_FORMAT_FEATURE_STORAGE_IMAGE_BIT
,usage
must not containVK_IMAGE_USAGE_STORAGE_BIT
- If
tiling
isVK_IMAGE_TILING_OPTIMAL
, andVkFormatProperties
::optimalTilingFeatures
(as returned byvkGetPhysicalDeviceFormatProperties
with the same value offormat
) does not includeVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT
,usage
must not containVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
- If
tiling
isVK_IMAGE_TILING_OPTIMAL
, andVkFormatProperties
::optimalTilingFeatures
(as returned byvkGetPhysicalDeviceFormatProperties
with the same value offormat
) does not includeVK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT
,usage
must not containVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
- If
flags
containsVK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
orVK_IMAGE_CREATE_SPARSE_ALIASED_BIT
, it must also containVK_IMAGE_CREATE_SPARSE_BINDING_BIT
- If any of the bits
VK_IMAGE_CREATE_SPARSE_BINDING_BIT
,VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
, orVK_IMAGE_CREATE_SPARSE_ALIASED_BIT
are set,VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT
must not also be set - If the
pNext
chain contains an instance ofVkExternalMemoryImageCreateInfoNV
, it must not contain an instance ofVkExternalMemoryImageCreateInfo
. - If the
pNext
chain contains an instance ofVkExternalMemoryImageCreateInfo
, itshandleTypes
member must only contain bits that are also inVkExternalImageFormatProperties
::externalMemoryProperties
::compatibleHandleTypes
, as returned byvkGetPhysicalDeviceImageFormatProperties2
withformat
,imageType
,tiling
,usage
, andflags
equal to those in this structure, and with an instance ofVkPhysicalDeviceExternalImageFormatInfo
in thepNext
chain, with ahandleType
equal to any one of the handle types specified inVkExternalMemoryImageCreateInfo
::handleTypes
- If the
pNext
chain contains an instance ofVkExternalMemoryImageCreateInfoNV
, itshandleTypes
member must only contain bits that are also inVkExternalImageFormatPropertiesNV
::externalMemoryProperties
::compatibleHandleTypes
, as returned byvkGetPhysicalDeviceExternalImageFormatPropertiesNV
withformat
,imageType
,tiling
,usage
, andflags
equal to those in this structure, and withexternalHandleType
equal to any one of the handle types specified inVkExternalMemoryImageCreateInfoNV
::handleTypes
- If the logical device was created with
VkDeviceGroupDeviceCreateInfo
::physicalDeviceCount
equal to 1,flags
must not containVK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT
- If
flags
containsVK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT
, thenmipLevels
must be one,arrayLayers
must be one,imageType
must beVK_IMAGE_TYPE_2D
, andtiling
must beVK_IMAGE_TILING_OPTIMAL
- If
flags
containsVK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT
, thenformat
must be a block-compressed image format, an ETC compressed image format, or an ASTC compressed image format. - If
flags
containsVK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT
, thenflags
must also containVK_IMAGE_CREATE_MUTABLE_FORMAT_BIT
. initialLayout
must beVK_IMAGE_LAYOUT_UNDEFINED
orVK_IMAGE_LAYOUT_PREINITIALIZED
.- If the
pNext
chain includes aVkExternalMemoryImageCreateInfo
orVkExternalMemoryImageCreateInfoNV
structure whosehandleTypes
member is not0
,initialLayout
must beVK_IMAGE_LAYOUT_UNDEFINED
If the image
format
is one of those listed in {html_spec_relative}#features-formats-requiring-sampler-ycbcr-conversion:mipLevels
must be 1samples
must beVK_SAMPLE_COUNT_1_BIT
imageType
must beVK_IMAGE_TYPE_2D
arrayLayers
must be 1
- If
tiling
isVK_IMAGE_TILING_OPTIMAL
,format
is a multi-planar format, andVkFormatProperties
::optimalTilingFeatures
(as returned byvkGetPhysicalDeviceFormatProperties
with the same value offormat
) does not includeVK_FORMAT_FEATURE_DISJOINT_BIT
,flags
must not containVK_IMAGE_CREATE_DISJOINT_BIT
- If
tiling
isVK_IMAGE_TILING_LINEAR
,format
is a multi-planar format, andVkFormatProperties
::linearTilingFeatures
(as returned byvkGetPhysicalDeviceFormatProperties
with the same value offormat
) does not includeVK_FORMAT_FEATURE_DISJOINT_BIT
,flags
must not containVK_IMAGE_CREATE_DISJOINT_BIT
- If
format
is not a multi-planar format, andflags
does not includeVK_IMAGE_CREATE_ALIAS_BIT
,flags
must not containVK_IMAGE_CREATE_DISJOINT_BIT
- If
flags
containsVK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT
format
must be a depth or depth/stencil format If the
pNext
chain includes aVkExternalMemoryImageCreateInfo
structure whosehandleTypes
member includesVK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID
:imageType
must beVK_IMAGE_TYPE_2D
mipLevels
must either be1
or equal to ⌊log2(max(extent.width
,extent.height
,extent.depth
))⌋ + 1.- If
format
is notVK_FORMAT_UNDEFINED
, thenformat
,imageType
,tiling
,usage
,flags
,mipLevels
, andsamples
must be supported withVK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID
external memory handle types according tovkGetPhysicalDeviceImageFormatProperties2
- If
format
isVK_FORMAT_UNDEFINED
, then thepNext
chain must include aVkExternalFormatANDROID
structure whoseexternalFormat
member is not0
If the
pNext
chain includes aVkExternalFormatANDROID
structure whoseexternalFormat
member is not0
:format
must beVK_FORMAT_UNDEFINED
flags
must not include VK_IMAGE_CREATE_MUTABLE_FORMAT_BITusage
must not include any usages exceptVK_IMAGE_USAGE_SAMPLED_BIT
tiling
must beVK_IMAGE_TILING_OPTIMAL
Valid Usage (Implicit)
sType
must beVK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
- Each
pNext
member of any structure (including this one) in thepNext
chain must be eitherNULL
or a pointer to a valid instance ofVkDedicatedAllocationImageCreateInfoNV
,VkExternalFormatANDROID
,VkExternalMemoryImageCreateInfo
,VkExternalMemoryImageCreateInfoNV
,VkImageFormatListCreateInfoKHR
, orVkImageSwapchainCreateInfoKHR
- Each
sType
member in thepNext
chain must be unique flags
must be a valid combination ofVkImageCreateFlagBits
valuesimageType
must be a validVkImageType
valueformat
must be a validVkFormat
valuesamples
must be a validVkSampleCountFlagBits
valuetiling
must be a validVkImageTiling
valueusage
must be a valid combination ofVkImageUsageFlagBits
valuesusage
must not be0
sharingMode
must be a validVkSharingMode
valueinitialLayout
must be a validVkImageLayout
value
See Also
VkExtent3D
,
VkFormat
,
VkImageCreateFlags
,
VkImageLayout
,
VkImageTiling
,
VkImageType
,
VkImageUsageFlags
,
VkSampleCountFlagBits
,
VkSharingMode
,
VkStructureType
, vkCreateImage
VkImageCreateInfo | |
|
Instances
Eq VkImageCreateInfo Source # | |
(==) :: VkImageCreateInfo -> VkImageCreateInfo -> Bool # (/=) :: VkImageCreateInfo -> VkImageCreateInfo -> Bool # | |
Show VkImageCreateInfo Source # | |
showsPrec :: Int -> VkImageCreateInfo -> ShowS # show :: VkImageCreateInfo -> String # showList :: [VkImageCreateInfo] -> ShowS # | |
Storable VkImageCreateInfo Source # | |
sizeOf :: VkImageCreateInfo -> Int # alignment :: VkImageCreateInfo -> Int # peekElemOff :: Ptr VkImageCreateInfo -> Int -> IO VkImageCreateInfo # pokeElemOff :: Ptr VkImageCreateInfo -> Int -> VkImageCreateInfo -> IO () # peekByteOff :: Ptr b -> Int -> IO VkImageCreateInfo # pokeByteOff :: Ptr b -> Int -> VkImageCreateInfo -> IO () # peek :: Ptr VkImageCreateInfo -> IO VkImageCreateInfo # poke :: Ptr VkImageCreateInfo -> VkImageCreateInfo -> IO () # |
data VkSubresourceLayout Source #
VkSubresourceLayout - Structure specifying subresource layout
Description
For images created with linear tiling, rowPitch
, arrayPitch
and
depthPitch
describe the layout of the image subresource in linear
memory. For uncompressed formats, rowPitch
is the number of bytes
between texels with the same x coordinate in adjacent rows (y
coordinates differ by one). arrayPitch
is the number of bytes between
texels with the same x and y coordinate in adjacent array layers of the
image (array layer values differ by one). depthPitch
is the number of
bytes between texels with the same x and y coordinate in adjacent slices
of a 3D image (z coordinates differ by one). Expressed as an addressing
formula, the starting byte of a texel in the image subresource has
address:
// (x,y,z,layer) are in texel coordinates address(x,y,z,layer) = layer*arrayPitch + z*depthPitch + y*rowPitch + x*elementSize + offset
For compressed formats, the rowPitch
is the number of bytes between
compressed texel blocks in adjacent rows. arrayPitch
is the number of
bytes between compressed texel blocks in adjacent array layers.
depthPitch
is the number of bytes between compressed texel blocks in
adjacent slices of a 3D image.
// (x,y,z,layer) are in compressed texel block coordinates address(x,y,z,layer) = layer*arrayPitch + z*depthPitch + y*rowPitch + x*compressedTexelBlockByteSize + offset;
arrayPitch
is undefined for images that were not created as arrays.
depthPitch
is defined only for 3D images.
For single-plane color formats, the aspectMask
member of
VkImageSubresource
must be VK_IMAGE_ASPECT_COLOR_BIT
. For
depth/stencil formats, aspectMask
must be either
VK_IMAGE_ASPECT_DEPTH_BIT
or VK_IMAGE_ASPECT_STENCIL_BIT
. On
implementations that store depth and stencil aspects separately,
querying each of these image subresource layouts will return a different
offset
and size
representing the region of memory used for that
aspect. On implementations that store depth and stencil aspects
interleaved, the same offset
and size
are returned and represent the
interleaved memory allocation.
For multi-planar
formats,
the aspectMask
member of VkImageSubresource
must be
VK_IMAGE_ASPECT_PLANE_0_BIT
, VK_IMAGE_ASPECT_PLANE_1_BIT
, or (for
3-plane formats only) VK_IMAGE_ASPECT_PLANE_2_BIT
. Querying each of
these image subresource layouts will return a different offset
and
size
representing the region of memory used for that plane.
See Also
VkDeviceSize
, vkGetImageSubresourceLayout
VkSubresourceLayout | |
|
Instances
Eq VkSubresourceLayout Source # | |
(==) :: VkSubresourceLayout -> VkSubresourceLayout -> Bool # (/=) :: VkSubresourceLayout -> VkSubresourceLayout -> Bool # | |
Show VkSubresourceLayout Source # | |
showsPrec :: Int -> VkSubresourceLayout -> ShowS # show :: VkSubresourceLayout -> String # showList :: [VkSubresourceLayout] -> ShowS # | |
Storable VkSubresourceLayout Source # | |
sizeOf :: VkSubresourceLayout -> Int # alignment :: VkSubresourceLayout -> Int # peekElemOff :: Ptr VkSubresourceLayout -> Int -> IO VkSubresourceLayout # pokeElemOff :: Ptr VkSubresourceLayout -> Int -> VkSubresourceLayout -> IO () # peekByteOff :: Ptr b -> Int -> IO VkSubresourceLayout # pokeByteOff :: Ptr b -> Int -> VkSubresourceLayout -> IO () # peek :: Ptr VkSubresourceLayout -> IO VkSubresourceLayout # poke :: Ptr VkSubresourceLayout -> VkSubresourceLayout -> IO () # |