| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Graphics.Vulkan.Core10.Image
- 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_UNDEFINEDdoes not support device access. This layout must only be used as theinitialLayoutmember ofVkImageCreateInfoorVkAttachmentDescription, or as theoldLayoutin an image transition. When transitioning out of this layout, the contents of the memory are not guaranteed to be preserved.VK_IMAGE_LAYOUT_PREINITIALIZEDdoes not support device access. This layout must only be used as theinitialLayoutmember ofVkImageCreateInfoorVkAttachmentDescription, or as theoldLayoutin 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_PREINITIALIZEDis only useful withVK_IMAGE_TILING_LINEARimages because there is not a standard layout defined forVK_IMAGE_TILING_OPTIMALimages.VK_IMAGE_LAYOUT_GENERALsupports all types of device access.VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMALmust 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_BITusage bit enabled.VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMALmust 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_BITusage bit enabled.VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMALmust only be used as a read-only depth/stencil attachment in aVkFramebufferand/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_BITusage bit enabled. Only image subresources of images created withVK_IMAGE_USAGE_SAMPLED_BITcan 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_BITcan 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_BITusage bit enabled. Only image subresources of images created withVK_IMAGE_USAGE_SAMPLED_BITcan 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_BITcan 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_BITusage bit enabled. Only image subresources of images created withVK_IMAGE_USAGE_SAMPLED_BITcan 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_BITcan be used as input attachments.VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMALmust 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_BITorVK_IMAGE_USAGE_INPUT_ATTACHMENT_BITusage bit enabled.VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMALmust 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_BITusage bit enabled.VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMALmust 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_BITusage bit enabled.VK_IMAGE_LAYOUT_PRESENT_SRC_KHRmust 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_KHRis 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
Constructors
| VkImageLayout Int32 |
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
deviceis the logical device that creates the image.
pCreateInfois a pointer to an instance of theVkImageCreateInfostructure containing parameters to be used to create the image.pAllocatorcontrols host memory allocation as described in the Memory Allocation chapter.pImagepoints to aVkImagehandle in which the resulting image object is returned.
Description
Valid Usage
- If the
flagsmember ofpCreateInfoincludesVK_IMAGE_CREATE_SPARSE_BINDING_BIT, creating thisVkImagemust not cause the total required sparse memory for all currently valid sparse resources on the device to exceedVkPhysicalDeviceLimits::sparseAddressSpaceSize
Valid Usage (Implicit)
devicemust be a validVkDevicehandle
pCreateInfomust be a valid pointer to a validVkImageCreateInfostructure- If
pAllocatoris notNULL,pAllocatormust be a valid pointer to a validVkAllocationCallbacksstructure pImagemust be a valid pointer to aVkImagehandle
Return Codes
- Success
- -
VK_SUCCESS
- Failure
- -
VK_ERROR_OUT_OF_HOST_MEMORYVK_ERROR_OUT_OF_DEVICE_MEMORY
See Also
vkDestroyImage :: ("device" ::: VkDevice) -> ("image" ::: VkImage) -> ("pAllocator" ::: Ptr VkAllocationCallbacks) -> IO () Source #
vkDestroyImage - Destroy an image object
Parameters
deviceis the logical device that destroys the image.
imageis the image to destroy.pAllocatorcontrols host memory allocation as described in the Memory Allocation chapter.
Description
Valid Usage
- All submitted commands that refer to
image, either directly or via aVkImageView, must have completed execution
- If
VkAllocationCallbackswere provided whenimagewas created, a compatible set of callbacks must be provided here - If no
VkAllocationCallbackswere provided whenimagewas created,pAllocatormust beNULL
Valid Usage (Implicit)
devicemust be a validVkDevicehandle
- If
imageis notVK_NULL_HANDLE,imagemust be a validVkImagehandle - If
pAllocatoris notNULL,pAllocatormust be a valid pointer to a validVkAllocationCallbacksstructure - If
imageis a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
imagemust 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
deviceis the logical device that owns the image.
imageis the image whose layout is being queried.pSubresourceis a pointer to aVkImageSubresourcestructure selecting a specific image for the image subresource.pLayoutpoints to aVkSubresourceLayoutstructure 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
imagemust have been created withtilingequal toVK_IMAGE_TILING_LINEAR
- The
aspectMaskmember ofpSubresourcemust only have a single bit set - The
mipLevelmember ofpSubresourcemust be less than themipLevelsspecified inVkImageCreateInfowhenimagewas created - The
arrayLayermember ofpSubresourcemust be less than thearrayLayersspecified inVkImageCreateInfowhenimagewas created - If the
formatofimageis a multi-planar format with two planes, theaspectMaskmember ofpSubresourcemust beVK_IMAGE_ASPECT_PLANE_0_BITorVK_IMAGE_ASPECT_PLANE_1_BIT - If the
formatofimageis a multi-planar format with three planes, theaspectMaskmember ofpSubresourcemust beVK_IMAGE_ASPECT_PLANE_0_BIT,VK_IMAGE_ASPECT_PLANE_1_BITorVK_IMAGE_ASPECT_PLANE_2_BIT - If
imagewas created with the VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID external memory handle type, thenimagemust be bound to memory.
Valid Usage (Implicit)
devicemust be a validVkDevicehandle
imagemust be a validVkImagehandlepSubresourcemust be a valid pointer to a validVkImageSubresourcestructurepLayoutmust be a valid pointer to aVkSubresourceLayoutstructureimagemust 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:
imageTypeisVK_IMAGE_TYPE_2Dformatis not a depth/stencil formatmipLevelsis 1arrayLayersis 1samplesisVK_SAMPLE_COUNT_1_BITusageonly includesVK_IMAGE_USAGE_TRANSFER_SRC_BITand/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
pNextchain doesn’t contain an instance ofVkExternalFormatANDROID, or ifformatis not VK_FORMAT_UNDEFINED, the combination offormat,imageType,tiling,usage, andflagsmust be supported, as indicated by aVK_SUCCESSreturn value fromvkGetPhysicalDeviceImageFormatPropertiesinvoked with the same values passed to the corresponding parameters.
- If
sharingModeisVK_SHARING_MODE_CONCURRENT,pQueueFamilyIndicesmust be a valid pointer to an array ofqueueFamilyIndexCountuint32_tvalues - If
sharingModeisVK_SHARING_MODE_CONCURRENT,queueFamilyIndexCountmust be greater than1 - If
sharingModeisVK_SHARING_MODE_CONCURRENT, each element ofpQueueFamilyIndicesmust be unique and must be less thanpQueueFamilyPropertyCountreturned by eithervkGetPhysicalDeviceQueueFamilyPropertiesorvkGetPhysicalDeviceQueueFamilyProperties2for thephysicalDevicethat was used to createdevice formatmust not beVK_FORMAT_UNDEFINEDextent::widthmust be greater than0.extent::heightmust be greater than0.extent::depthmust be greater than0.mipLevelsmust be greater than0arrayLayersmust be greater than0- If
flagscontainsVK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT,imageTypemust beVK_IMAGE_TYPE_2D - If
flagscontainsVK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT,imageTypemust beVK_IMAGE_TYPE_3D - If
imageTypeisVK_IMAGE_TYPE_1D,extent.widthmust be less than or equal toVkPhysicalDeviceLimits::maxImageDimension1D, orVkImageFormatProperties::maxExtent.width(as returned byvkGetPhysicalDeviceImageFormatPropertieswithformat,imageType,tiling,usage, andflagsequal to those in this structure) - whichever is higher - If
imageTypeisVK_IMAGE_TYPE_2Dandflagsdoes not containVK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT,extent.widthandextent.heightmust be less than or equal toVkPhysicalDeviceLimits::maxImageDimension2D, orVkImageFormatProperties::maxExtent.width/height(as returned byvkGetPhysicalDeviceImageFormatPropertieswithformat,imageType,tiling,usage, andflagsequal to those in this structure) - whichever is higher - If
imageTypeisVK_IMAGE_TYPE_2DandflagscontainsVK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT,extent.widthandextent.heightmust be less than or equal toVkPhysicalDeviceLimits::maxImageDimensionCube, orVkImageFormatProperties::maxExtent.width/height(as returned byvkGetPhysicalDeviceImageFormatPropertieswithformat,imageType,tiling,usage, andflagsequal to those in this structure) - whichever is higher - If
imageTypeisVK_IMAGE_TYPE_2DandflagscontainsVK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT,extent.widthandextent.heightmust be equal andarrayLayersmust be greater than or equal to 6 - If
imageTypeisVK_IMAGE_TYPE_3D,extent.width,extent.heightandextent.depthmust be less than or equal toVkPhysicalDeviceLimits::maxImageDimension3D, orVkImageFormatProperties::maxExtent.width/height/depth(as returned byvkGetPhysicalDeviceImageFormatPropertieswithformat,imageType,tiling,usage, andflagsequal to those in this structure) - whichever is higher - If
imageTypeisVK_IMAGE_TYPE_1D, bothextent.heightandextent.depthmust be1 - If
imageTypeisVK_IMAGE_TYPE_2D,extent.depthmust be1 mipLevelsmust be less than or equal to ⌊log2(max(extent.width,extent.height,extent.depth))⌋ + 1.mipLevelsmust be less than or equal toVkImageFormatProperties::maxMipLevels(as returned byvkGetPhysicalDeviceImageFormatPropertieswithformat,imageType,tiling,usage, andflagsequal to those in this structure)arrayLayersmust be less than or equal toVkImageFormatProperties::maxArrayLayers(as returned byvkGetPhysicalDeviceImageFormatPropertieswithformat,imageType,tiling,usage, andflagsequal to those in this structure)- If
imageTypeisVK_IMAGE_TYPE_3D,arrayLayersmust be1. - If
samplesis notVK_SAMPLE_COUNT_1_BIT,imageTypemust beVK_IMAGE_TYPE_2D,flagsmust not containVK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT,tilingmust beVK_IMAGE_TILING_OPTIMAL, andmipLevelsmust be equal to1 - If
usageincludesVK_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_BITmust not be set - If
usageincludesVK_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.widthmust be less than or equal toVkPhysicalDeviceLimits::maxFramebufferWidth - If
usageincludesVK_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.heightmust be less than or equal toVkPhysicalDeviceLimits::maxFramebufferHeight - If
usageincludesVK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT,usagemust also contain at least one ofVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, orVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT. samplesmust be a bit value that is set inVkImageFormatProperties::sampleCountsreturned byvkGetPhysicalDeviceImageFormatPropertieswithformat,imageType,tiling,usage, andflagsequal to those in this structure- If the
multisampled storage images
feature is not enabled, and
usagecontainsVK_IMAGE_USAGE_STORAGE_BIT,samplesmust beVK_SAMPLE_COUNT_1_BIT - If the
sparse bindings
feature is not enabled,
flagsmust not containVK_IMAGE_CREATE_SPARSE_BINDING_BIT - If the
sparse aliased residency
feature is not enabled,
flagsmust not containVK_IMAGE_CREATE_SPARSE_ALIASED_BIT - If
imageTypeisVK_IMAGE_TYPE_1D,flagsmust not containVK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT - If the
sparse residency for 2D images
feature is not enabled, and
imageTypeisVK_IMAGE_TYPE_2D,flagsmust not containVK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT - If the
sparse residency for 3D images
feature is not enabled, and
imageTypeisVK_IMAGE_TYPE_3D,flagsmust not containVK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT - If the
sparse residency for images with 2 samples
feature is not enabled,
imageTypeisVK_IMAGE_TYPE_2D, andsamplesisVK_SAMPLE_COUNT_2_BIT,flagsmust not containVK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT - If the
sparse residency for images with 4 samples
feature is not enabled,
imageTypeisVK_IMAGE_TYPE_2D, andsamplesisVK_SAMPLE_COUNT_4_BIT,flagsmust not containVK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT - If the
sparse residency for images with 8 samples
feature is not enabled,
imageTypeisVK_IMAGE_TYPE_2D, andsamplesisVK_SAMPLE_COUNT_8_BIT,flagsmust not containVK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT - If the
sparse residency for images with 16 samples
feature is not enabled,
imageTypeisVK_IMAGE_TYPE_2D, andsamplesisVK_SAMPLE_COUNT_16_BIT,flagsmust not containVK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT - If
tilingisVK_IMAGE_TILING_LINEAR,formatmust be a format that has at least one supported feature bit present in the value ofVkFormatProperties::linearTilingFeaturesreturned byvkGetPhysicalDeviceFormatPropertieswith the same value offormat - If
tilingisVK_IMAGE_TILING_LINEAR, andVkFormatProperties::linearTilingFeatures(as returned byvkGetPhysicalDeviceFormatPropertieswith the same value offormat) does not includeVK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT,usagemust not containVK_IMAGE_USAGE_SAMPLED_BIT - If
tilingisVK_IMAGE_TILING_LINEAR, andVkFormatProperties::linearTilingFeatures(as returned byvkGetPhysicalDeviceFormatPropertieswith the same value offormat) does not includeVK_FORMAT_FEATURE_STORAGE_IMAGE_BIT,usagemust not containVK_IMAGE_USAGE_STORAGE_BIT - If
tilingisVK_IMAGE_TILING_LINEAR, andVkFormatProperties::linearTilingFeatures(as returned byvkGetPhysicalDeviceFormatPropertieswith the same value offormat) does not includeVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT,usagemust not containVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT - If
tilingisVK_IMAGE_TILING_LINEAR, andVkFormatProperties::linearTilingFeatures(as returned byvkGetPhysicalDeviceFormatPropertieswith the same value offormat) does not includeVK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT,usagemust not containVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT - If
tilingisVK_IMAGE_TILING_OPTIMAL,formatmust be a format that has at least one supported feature bit present in the value ofVkFormatProperties::optimalTilingFeaturesreturned byvkGetPhysicalDeviceFormatPropertieswith the same value offormat - If
tilingisVK_IMAGE_TILING_OPTIMAL, andVkFormatProperties::optimalTilingFeatures(as returned byvkGetPhysicalDeviceFormatPropertieswith the same value offormat) does not includeVK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT,usagemust not containVK_IMAGE_USAGE_SAMPLED_BIT - If
tilingisVK_IMAGE_TILING_OPTIMAL, andVkFormatProperties::optimalTilingFeatures(as returned byvkGetPhysicalDeviceFormatPropertieswith the same value offormat) does not includeVK_FORMAT_FEATURE_STORAGE_IMAGE_BIT,usagemust not containVK_IMAGE_USAGE_STORAGE_BIT - If
tilingisVK_IMAGE_TILING_OPTIMAL, andVkFormatProperties::optimalTilingFeatures(as returned byvkGetPhysicalDeviceFormatPropertieswith the same value offormat) does not includeVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT,usagemust not containVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT - If
tilingisVK_IMAGE_TILING_OPTIMAL, andVkFormatProperties::optimalTilingFeatures(as returned byvkGetPhysicalDeviceFormatPropertieswith the same value offormat) does not includeVK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT,usagemust not containVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT - If
flagscontainsVK_IMAGE_CREATE_SPARSE_RESIDENCY_BITorVK_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_BITare set,VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BITmust not also be set - If the
pNextchain contains an instance ofVkExternalMemoryImageCreateInfoNV, it must not contain an instance ofVkExternalMemoryImageCreateInfo. - If the
pNextchain contains an instance ofVkExternalMemoryImageCreateInfo, itshandleTypesmember must only contain bits that are also inVkExternalImageFormatProperties::externalMemoryProperties::compatibleHandleTypes, as returned byvkGetPhysicalDeviceImageFormatProperties2withformat,imageType,tiling,usage, andflagsequal to those in this structure, and with an instance ofVkPhysicalDeviceExternalImageFormatInfoin thepNextchain, with ahandleTypeequal to any one of the handle types specified inVkExternalMemoryImageCreateInfo::handleTypes - If the
pNextchain contains an instance ofVkExternalMemoryImageCreateInfoNV, itshandleTypesmember must only contain bits that are also inVkExternalImageFormatPropertiesNV::externalMemoryProperties::compatibleHandleTypes, as returned byvkGetPhysicalDeviceExternalImageFormatPropertiesNVwithformat,imageType,tiling,usage, andflagsequal to those in this structure, and withexternalHandleTypeequal to any one of the handle types specified inVkExternalMemoryImageCreateInfoNV::handleTypes - If the logical device was created with
VkDeviceGroupDeviceCreateInfo::physicalDeviceCountequal to 1,flagsmust not containVK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT - If
flagscontainsVK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT, thenmipLevelsmust be one,arrayLayersmust be one,imageTypemust beVK_IMAGE_TYPE_2D, andtilingmust beVK_IMAGE_TILING_OPTIMAL - If
flagscontainsVK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT, thenformatmust be a block-compressed image format, an ETC compressed image format, or an ASTC compressed image format. - If
flagscontainsVK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT, thenflagsmust also containVK_IMAGE_CREATE_MUTABLE_FORMAT_BIT. initialLayoutmust beVK_IMAGE_LAYOUT_UNDEFINEDorVK_IMAGE_LAYOUT_PREINITIALIZED.- If the
pNextchain includes aVkExternalMemoryImageCreateInfoorVkExternalMemoryImageCreateInfoNVstructure whosehandleTypesmember is not0,initialLayoutmust beVK_IMAGE_LAYOUT_UNDEFINED If the image
formatis one of those listed in {html_spec_relative}#features-formats-requiring-sampler-ycbcr-conversion:mipLevelsmust be 1samplesmust beVK_SAMPLE_COUNT_1_BITimageTypemust beVK_IMAGE_TYPE_2DarrayLayersmust be 1
- If
tilingisVK_IMAGE_TILING_OPTIMAL,formatis a multi-planar format, andVkFormatProperties::optimalTilingFeatures(as returned byvkGetPhysicalDeviceFormatPropertieswith the same value offormat) does not includeVK_FORMAT_FEATURE_DISJOINT_BIT,flagsmust not containVK_IMAGE_CREATE_DISJOINT_BIT - If
tilingisVK_IMAGE_TILING_LINEAR,formatis a multi-planar format, andVkFormatProperties::linearTilingFeatures(as returned byvkGetPhysicalDeviceFormatPropertieswith the same value offormat) does not includeVK_FORMAT_FEATURE_DISJOINT_BIT,flagsmust not containVK_IMAGE_CREATE_DISJOINT_BIT - If
formatis not a multi-planar format, andflagsdoes not includeVK_IMAGE_CREATE_ALIAS_BIT,flagsmust not containVK_IMAGE_CREATE_DISJOINT_BIT - If
flagscontainsVK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXTformatmust be a depth or depth/stencil format If the
pNextchain includes aVkExternalMemoryImageCreateInfostructure whosehandleTypesmember includesVK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID:imageTypemust beVK_IMAGE_TYPE_2DmipLevelsmust either be1or equal to ⌊log2(max(extent.width,extent.height,extent.depth))⌋ + 1.- If
formatis notVK_FORMAT_UNDEFINED, thenformat,imageType,tiling,usage,flags,mipLevels, andsamplesmust be supported withVK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROIDexternal memory handle types according tovkGetPhysicalDeviceImageFormatProperties2 - If
formatisVK_FORMAT_UNDEFINED, then thepNextchain must include aVkExternalFormatANDROIDstructure whoseexternalFormatmember is not0
If the
pNextchain includes aVkExternalFormatANDROIDstructure whoseexternalFormatmember is not0:formatmust beVK_FORMAT_UNDEFINEDflagsmust not include VK_IMAGE_CREATE_MUTABLE_FORMAT_BITusagemust not include any usages exceptVK_IMAGE_USAGE_SAMPLED_BITtilingmust beVK_IMAGE_TILING_OPTIMAL
Valid Usage (Implicit)
sTypemust beVK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
- Each
pNextmember of any structure (including this one) in thepNextchain must be eitherNULLor a pointer to a valid instance ofVkDedicatedAllocationImageCreateInfoNV,VkExternalFormatANDROID,VkExternalMemoryImageCreateInfo,VkExternalMemoryImageCreateInfoNV,VkImageFormatListCreateInfoKHR, orVkImageSwapchainCreateInfoKHR - Each
sTypemember in thepNextchain must be unique flagsmust be a valid combination ofVkImageCreateFlagBitsvaluesimageTypemust be a validVkImageTypevalueformatmust be a validVkFormatvaluesamplesmust be a validVkSampleCountFlagBitsvaluetilingmust be a validVkImageTilingvalueusagemust be a valid combination ofVkImageUsageFlagBitsvaluesusagemust not be0sharingModemust be a validVkSharingModevalueinitialLayoutmust be a validVkImageLayoutvalue
See Also
VkExtent3D,
VkFormat,
VkImageCreateFlags,
VkImageLayout,
VkImageTiling,
VkImageType,
VkImageUsageFlags,
VkSampleCountFlagBits,
VkSharingMode,
VkStructureType, vkCreateImage
Constructors
| VkImageCreateInfo | |
Fields
| |
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
Constructors
| VkSubresourceLayout | |
Fields
| |