| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Vulkan.Core10.Image
Synopsis
- createImage :: forall a io. (Extendss ImageCreateInfo a, PokeChain a, MonadIO io) => Device -> ImageCreateInfo a -> ("allocator" ::: Maybe AllocationCallbacks) -> io Image
- withImage :: forall a io r. (Extendss ImageCreateInfo a, PokeChain a, MonadIO io) => Device -> ImageCreateInfo a -> Maybe AllocationCallbacks -> (io Image -> (Image -> io ()) -> r) -> r
- destroyImage :: forall io. MonadIO io => Device -> Image -> ("allocator" ::: Maybe AllocationCallbacks) -> io ()
- getImageSubresourceLayout :: forall io. MonadIO io => Device -> Image -> ImageSubresource -> io SubresourceLayout
- data ImageCreateInfo (es :: [Type]) = ImageCreateInfo {
- next :: Chain es
- flags :: ImageCreateFlags
- imageType :: ImageType
- format :: Format
- extent :: Extent3D
- mipLevels :: Word32
- arrayLayers :: Word32
- samples :: SampleCountFlagBits
- tiling :: ImageTiling
- usage :: ImageUsageFlags
- sharingMode :: SharingMode
- queueFamilyIndices :: Vector Word32
- initialLayout :: ImageLayout
- data SubresourceLayout = SubresourceLayout {}
- newtype Image = Image Word64
- newtype ImageLayout where
- ImageLayout Int32
- pattern IMAGE_LAYOUT_UNDEFINED :: ImageLayout
- pattern IMAGE_LAYOUT_GENERAL :: ImageLayout
- pattern IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL :: ImageLayout
- pattern IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL :: ImageLayout
- pattern IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL :: ImageLayout
- pattern IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL :: ImageLayout
- pattern IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL :: ImageLayout
- pattern IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL :: ImageLayout
- pattern IMAGE_LAYOUT_PREINITIALIZED :: ImageLayout
- pattern IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT :: ImageLayout
- pattern IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV :: ImageLayout
- pattern IMAGE_LAYOUT_SHARED_PRESENT_KHR :: ImageLayout
- pattern IMAGE_LAYOUT_PRESENT_SRC_KHR :: ImageLayout
- pattern IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL :: ImageLayout
- pattern IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL :: ImageLayout
- pattern IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL :: ImageLayout
- pattern IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL :: ImageLayout
- pattern IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL :: ImageLayout
- pattern IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL :: ImageLayout
Documentation
Arguments
| :: forall a io. (Extendss ImageCreateInfo a, PokeChain a, MonadIO io) | |
| => Device |
|
| -> ImageCreateInfo a |
|
| -> ("allocator" ::: Maybe AllocationCallbacks) |
|
| -> io Image |
vkCreateImage - Create a new image object
Valid Usage
- If the
flagsmember ofpCreateInfoincludesIMAGE_CREATE_SPARSE_BINDING_BIT, creating thisImagemust not cause the total required sparse memory for all currently valid sparse resources on the device to exceedPhysicalDeviceLimits::sparseAddressSpaceSize
Valid Usage (Implicit)
devicemust be a validDevicehandle
pCreateInfomust be a valid pointer to a validImageCreateInfostructure- If
pAllocatoris notNULL,pAllocatormust be a valid pointer to a validAllocationCallbacksstructure pImagemust be a valid pointer to aImagehandle
Return Codes
See Also
withImage :: forall a io r. (Extendss ImageCreateInfo a, PokeChain a, MonadIO io) => Device -> ImageCreateInfo a -> Maybe AllocationCallbacks -> (io Image -> (Image -> io ()) -> r) -> r Source #
A convenience wrapper to make a compatible pair of calls to
createImage and destroyImage
To ensure that destroyImage is always called: pass
bracket (or the allocate function from your
favourite resource management library) as the first argument.
To just extract the pair pass (,) as the first argument.
Arguments
| :: forall io. MonadIO io | |
| => Device |
|
| -> Image |
|
| -> ("allocator" ::: Maybe AllocationCallbacks) |
|
| -> io () |
vkDestroyImage - Destroy an image object
Valid Usage
- All submitted commands that refer to
image, either directly or via aImageView, must have completed execution
- If
AllocationCallbackswere provided whenimagewas created, a compatible set of callbacks must be provided here - If no
AllocationCallbackswere provided whenimagewas created,pAllocatormust beNULL
Valid Usage (Implicit)
devicemust be a validDevicehandle
- If
imageis notNULL_HANDLE,imagemust be a validImagehandle - If
pAllocatoris notNULL,pAllocatormust be a valid pointer to a validAllocationCallbacksstructure - 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
getImageSubresourceLayout Source #
Arguments
| :: forall io. MonadIO io | |
| => Device |
|
| -> Image |
|
| -> ImageSubresource |
|
| -> io SubresourceLayout |
vkGetImageSubresourceLayout - Retrieve information about an image subresource
Description
If the image is linear, then the returned layout is valid for host access.
If the image’s tiling is
IMAGE_TILING_LINEAR and its format is
a
multi-planar format,
then getImageSubresourceLayout describes one format plane of the
image. If the image’s tiling is
IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT,
then getImageSubresourceLayout describes one memory plane of the
image. If the image’s tiling is
IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT
and the image is
non-linear,
then the returned layout has an implementation-dependent meaning; the
vendor of the image’s
DRM format modifier
may provide documentation that explains how to interpret the returned
layout.
getImageSubresourceLayout is invariant for the lifetime of a single
image. However, the subresource layout of images in Android hardware
buffer external memory is not known until the image has been bound to
memory, so applications must not call getImageSubresourceLayout for
such an image before it has been bound.
Valid Usage
imagemust have been created withtilingequal toIMAGE_TILING_LINEARorIMAGE_TILING_DRM_FORMAT_MODIFIER_EXT
- The
aspectMaskmember ofpSubresourcemust only have a single bit set - The
mipLevelmember ofpSubresourcemust be less than themipLevelsspecified inImageCreateInfowhenimagewas created - The
arrayLayermember ofpSubresourcemust be less than thearrayLayersspecified inImageCreateInfowhenimagewas created - If the
tilingof theimageisIMAGE_TILING_LINEARand itsformatis a multi-planar format with two planes, theaspectMaskmember ofpSubresourcemust beIMAGE_ASPECT_PLANE_0_BITorIMAGE_ASPECT_PLANE_1_BIT - If the
tilingof theimageisIMAGE_TILING_LINEARand itsformatis a multi-planar format with three planes, theaspectMaskmember ofpSubresourcemust beIMAGE_ASPECT_PLANE_0_BIT,IMAGE_ASPECT_PLANE_1_BITorIMAGE_ASPECT_PLANE_2_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 indeximust be less than theDrmFormatModifierPropertiesEXT::drmFormatModifierPlaneCountassociated with the image’sformatandImageDrmFormatModifierPropertiesEXT::drmFormatModifier
Valid Usage (Implicit)
devicemust be a validDevicehandle
imagemust be a validImagehandlepSubresourcemust be a valid pointer to a validImageSubresourcestructurepLayoutmust be a valid pointer to aSubresourceLayoutstructureimagemust have been created, allocated, or retrieved fromdevice
See Also
data ImageCreateInfo (es :: [Type]) Source #
VkImageCreateInfo - Structure specifying the parameters of a newly created image object
Description
Images created with tiling equal to
IMAGE_TILING_LINEAR have further
restrictions on their limits and capabilities compared to images created
with tiling equal to
IMAGE_TILING_OPTIMAL. Creation of
images with tiling IMAGE_TILING_LINEAR
may not be supported unless other parameters meet all of the
constraints:
imageTypeisIMAGE_TYPE_2Dformatis not a depth/stencil formatmipLevelsis 1arrayLayersis 1samplesisSAMPLE_COUNT_1_BITusageonly includesIMAGE_USAGE_TRANSFER_SRC_BITand/orIMAGE_USAGE_TRANSFER_DST_BIT
Images created with a format from one of those listed in
https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion
have further restrictions on their limits and capabilities compared to
images created with other formats. Creation of images with a format
requiring
Y′CBCR conversion
may not be supported unless other parameters meet all of the
constraints:
imageTypeisIMAGE_TYPE_2DmipLevelsis 1arrayLayersis 1samplesisSAMPLE_COUNT_1_BIT
Implementations may support additional limits and capabilities beyond those listed above.
To determine the set of valid usage bits for a given format, call
getPhysicalDeviceFormatProperties.
If the size of the resultant image would exceed maxResourceSize, then
createImage must fail and return
ERROR_OUT_OF_DEVICE_MEMORY. This failure
may occur even when all image creation parameters satisfy their valid
usage requirements.
Note
For images created without
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
IMAGE_CREATE_EXTENDED_USAGE_BIT
a usage bit is valid if it is supported for at least one of the
formats a ImageView created from the image can
have (see
Image Views
for more detail).
Valid values for some image creation parameters are limited by a
numerical upper bound or by inclusion in a bitset. For example,
ImageCreateInfo::arrayLayers is limited by
imageCreateMaxArrayLayers, defined below; and
ImageCreateInfo::samples is limited by imageCreateSampleCounts,
also defined below.
Several limiting values are defined below, as well as assisting values
from which the limiting values are derived. The limiting values are
referenced by the relevant valid usage statements of ImageCreateInfo.
Let
uint64_t imageCreateDrmFormatModifiers[]be the set of Linux DRM format modifiers that the resultant image may have.- If
tilingis notIMAGE_TILING_DRM_FORMAT_MODIFIER_EXT, thenimageCreateDrmFormatModifiersis empty. - If
ImageCreateInfo::pNextcontainsImageDrmFormatModifierExplicitCreateInfoEXT, thenimageCreateDrmFormatModifierscontains exactly one modifier,ImageDrmFormatModifierExplicitCreateInfoEXT::drmFormatModifier. - If
ImageCreateInfo::pNextcontainsImageDrmFormatModifierListCreateInfoEXT, thenimageCreateDrmFormatModifierscontains the entire arrayImageDrmFormatModifierListCreateInfoEXT::pDrmFormatModifiers.
- If
Let
VkBool32 imageCreateMaybeLinearindicate if the resultant image may be linear.- If
tilingisIMAGE_TILING_LINEAR, thenimageCreateMaybeLinearistrue. - If
tilingisIMAGE_TILING_OPTIMAL, thenimageCreateMaybeLinearisfalse. - If
tilingisIMAGE_TILING_DRM_FORMAT_MODIFIER_EXT, thenimageCreateMaybeLinear_istrueif and only ifimageCreateDrmFormatModifierscontainsDRM_FORMAT_MOD_LINEAR.
- If
Let
VkFormatFeatureFlags imageCreateFormatFeaturesbe the set of valid format features available during image creation.- If
tilingisIMAGE_TILING_LINEAR, thenimageCreateFormatFeaturesis the value ofFormatProperties::linearTilingFeaturesfound by callinggetPhysicalDeviceFormatPropertieswith parameterformatequal toImageCreateInfo::format. - If
tilingisIMAGE_TILING_OPTIMAL, and if thepNextchain includes noExternalFormatANDROIDstructure with non-zeroexternalFormat, thenimageCreateFormatFeaturesis value ofFormatProperties::optimalTilingFeaturesfound by callinggetPhysicalDeviceFormatPropertieswith parameterformatequal toImageCreateInfo::format. - If
tilingisIMAGE_TILING_OPTIMAL, and if thepNextchain includes aExternalFormatANDROIDstructure with non-zeroexternalFormat, thenimageCreateFormatFeaturesis the value ofAndroidHardwareBufferFormatPropertiesANDROID::formatFeaturesobtained bygetAndroidHardwareBufferPropertiesANDROIDwith a matchingexternalFormatvalue. - If
tilingisIMAGE_TILING_DRM_FORMAT_MODIFIER_EXT, then the value ofimageCreateFormatFeaturesis found by callinggetPhysicalDeviceFormatProperties2withImageFormatProperties::formatequal toImageCreateInfo::formatand withDrmFormatModifierPropertiesListEXTchained intoImageFormatProperties2; by collecting all members of the returned arrayDrmFormatModifierPropertiesListEXT::pDrmFormatModifierPropertieswhosedrmFormatModifierbelongs toimageCreateDrmFormatModifiers; and by taking the bitwise intersection, over the collected array members, ofdrmFormatModifierTilingFeatures. (The resultantimageCreateFormatFeaturesmay be empty).
- If
Let
VkImageFormatProperties2 imageCreateImageFormatPropertiesList[]be defined as follows.If
ImageCreateInfo::pNextcontains noExternalFormatANDROIDstructure with non-zeroexternalFormat, thenimageCreateImageFormatPropertiesListis the list of structures obtained by callinggetPhysicalDeviceImageFormatProperties2, possibly multiple times, as follows:- The parameters
PhysicalDeviceImageFormatInfo2::format,imageType,tiling,usage, andflagsmust be equal to those inImageCreateInfo. - If
ImageCreateInfo::pNextcontains aExternalMemoryImageCreateInfostructure whosehandleTypesis not0, thenPhysicalDeviceImageFormatInfo2::pNextmust contain aPhysicalDeviceExternalImageFormatInfostructure whosehandleTypeis not0; andgetPhysicalDeviceImageFormatProperties2must be called for each handle type inExternalMemoryImageCreateInfo::handleTypes, successively settingPhysicalDeviceExternalImageFormatInfo::handleTypeon each call. - If
ImageCreateInfo::pNextcontains noExternalMemoryImageCreateInfostructure, or contains a structure whosehandleTypesis0, thenPhysicalDeviceImageFormatInfo2::pNextmust either contain noPhysicalDeviceExternalImageFormatInfostructure, or contain a structure whosehandleTypeis0. - If
tilingisIMAGE_TILING_DRM_FORMAT_MODIFIER_EXT, thenPhysicalDeviceImageFormatInfo2::pNextmust contain aPhysicalDeviceImageDrmFormatModifierInfoEXTstructure wheresharingModeis equal toImageCreateInfo::sharingMode; and, ifsharingModeisSHARING_MODE_CONCURRENT, thenqueueFamilyIndexCountandpQueueFamilyIndicesmust be equal to those inImageCreateInfo; and, ifflagscontainsIMAGE_CREATE_MUTABLE_FORMAT_BIT, then theImageFormatListCreateInfostructure included in thepNextchain ofPhysicalDeviceImageFormatInfo2must be equivalent to the one included in thepNextchain ofImageCreateInfo; andgetPhysicalDeviceImageFormatProperties2must be called for each modifier inimageCreateDrmFormatModifiers, successively settingPhysicalDeviceImageDrmFormatModifierInfoEXT::drmFormatModifieron each call. - If
tilingis notIMAGE_TILING_DRM_FORMAT_MODIFIER_EXT, thenPhysicalDeviceImageFormatInfo2::pNextmust contain noPhysicalDeviceImageDrmFormatModifierInfoEXTstructure. - If any call to
getPhysicalDeviceImageFormatProperties2returns an error, thenimageCreateImageFormatPropertiesListis defined to be the empty list.
- The parameters
If
ImageCreateInfo::pNextcontains aExternalFormatANDROIDstructure with non-zeroexternalFormat, thenimageCreateImageFormatPropertiesListcontains a single element where:ImageFormatProperties::maxMipLevelsis ⌊log2(max(extent.width,extent.height,extent.depth))⌋ + 1.ImageFormatProperties::maxArrayLayersisPhysicalDeviceLimits::maxImageArrayLayers.- Each component of
ImageFormatProperties::maxExtentisPhysicalDeviceLimits::maxImageDimension2D. ImageFormatProperties::sampleCountscontains exactlySAMPLE_COUNT_1_BIT.
- Let
uint32_t imageCreateMaxMipLevelsbe the minimum value ofImageFormatProperties::maxMipLevelsinimageCreateImageFormatPropertiesList. The value is undefined ifimageCreateImageFormatPropertiesListis empty. - Let
uint32_t imageCreateMaxArrayLayersbe the minimum value ofImageFormatProperties::maxArrayLayersinimageCreateImageFormatPropertiesList. The value is undefined ifimageCreateImageFormatPropertiesListis empty. - Let
VkExtent3D imageCreateMaxExtentbe the component-wise minimum over allImageFormatProperties::maxExtentvalues inimageCreateImageFormatPropertiesList. The value is undefined ifimageCreateImageFormatPropertiesListis empty. - Let
VkSampleCountFlags imageCreateSampleCountsbe the intersection of eachImageFormatProperties::sampleCountsinimageCreateImageFormatPropertiesList. The value is undefined ifimageCreateImageFormatPropertiesListis empty.
Valid Usage
- Each of the following values (as described in
Image Creation Limits)
must not be undefined
imageCreateMaxMipLevels,imageCreateMaxArrayLayers,imageCreateMaxExtent, andimageCreateSampleCounts
- If
sharingModeisSHARING_MODE_CONCURRENT,pQueueFamilyIndicesmust be a valid pointer to an array ofqueueFamilyIndexCountuint32_tvalues - If
sharingModeisSHARING_MODE_CONCURRENT,queueFamilyIndexCountmust be greater than1 - If
sharingModeisSHARING_MODE_CONCURRENT, each element ofpQueueFamilyIndicesmust be unique and must be less thanpQueueFamilyPropertyCountreturned by eithergetPhysicalDeviceQueueFamilyPropertiesorgetPhysicalDeviceQueueFamilyProperties2for thephysicalDevicethat was used to createdevice - If the
pNextchain includes aExternalFormatANDROIDstructure, and itsexternalFormatmember is non-zero theformatmust beFORMAT_UNDEFINED - If the
pNextchain does not include aExternalFormatANDROIDstructure, or does and itsexternalFormatmember is0, theformatmust not beFORMAT_UNDEFINED extent.widthmust be greater than0extent.heightmust be greater than0extent.depthmust be greater than0mipLevelsmust be greater than0arrayLayersmust be greater than0- If
flagscontainsIMAGE_CREATE_CUBE_COMPATIBLE_BIT,imageTypemust beIMAGE_TYPE_2D - If
flagscontainsIMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT,imageTypemust beIMAGE_TYPE_2D - If
flagscontainsIMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT,imageTypemust beIMAGE_TYPE_3D extent.widthmust be less than or equal toimageCreateMaxExtent.width(as defined in Image Creation Limits)extent.heightmust be less than or equal toimageCreateMaxExtent.height(as defined in Image Creation Limits)extent.depthmust be less than or equal toimageCreateMaxExtent.depth(as defined in Image Creation Limits)- If
imageTypeisIMAGE_TYPE_2DandflagscontainsIMAGE_CREATE_CUBE_COMPATIBLE_BIT,extent.widthandextent.heightmust be equal andarrayLayersmust be greater than or equal to 6 - If
imageTypeisIMAGE_TYPE_1D, bothextent.heightandextent.depthmust be1 - If
imageTypeisIMAGE_TYPE_2D,extent.depthmust be1 mipLevelsmust be less than or equal to the number of levels in the complete mipmap chain based onextent.width,extent.height, andextent.depthmipLevelsmust be less than or equal toimageCreateMaxMipLevels(as defined in Image Creation Limits)arrayLayersmust be less than or equal toimageCreateMaxArrayLayers(as defined in Image Creation Limits)- If
imageTypeisIMAGE_TYPE_3D,arrayLayersmust be1 - If
samplesis notSAMPLE_COUNT_1_BIT, thenimageTypemust beIMAGE_TYPE_2D,flagsmust not containIMAGE_CREATE_CUBE_COMPATIBLE_BIT,mipLevelsmust be equal to1, andimageCreateMaybeLinear(as defined in Image Creation Limits) must befalse, - If
samplesis notSAMPLE_COUNT_1_BIT,usagemust not containIMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT - If
usageincludesIMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT, then bits other thanIMAGE_USAGE_COLOR_ATTACHMENT_BIT,IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, andIMAGE_USAGE_INPUT_ATTACHMENT_BITmust not be set - If
usageincludesIMAGE_USAGE_COLOR_ATTACHMENT_BIT,IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT,IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT, orIMAGE_USAGE_INPUT_ATTACHMENT_BIT,extent.widthmust be less than or equal toPhysicalDeviceLimits::maxFramebufferWidth - If
usageincludesIMAGE_USAGE_COLOR_ATTACHMENT_BIT,IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT,IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT, orIMAGE_USAGE_INPUT_ATTACHMENT_BIT,extent.heightmust be less than or equal toPhysicalDeviceLimits::maxFramebufferHeight - If
usageincludesIMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT,extent.widthmust be less than or equal to \(\left\lceil{\frac{maxFramebufferWidth}{minFragmentDensityTexelSize_{width}}}\right\rceil\) - If
usageincludesIMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT,extent.heightmust be less than or equal to \(\left\lceil{\frac{maxFramebufferHeight}{minFragmentDensityTexelSize_{height}}}\right\rceil\) - If
usageincludesIMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT,usagemust also contain at least one ofIMAGE_USAGE_COLOR_ATTACHMENT_BIT,IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, orIMAGE_USAGE_INPUT_ATTACHMENT_BIT samplesmust be a bit value that is set inimageCreateSampleCounts(as defined in Image Creation Limits)- If the
multisampled storage images
feature is not enabled, and
usagecontainsIMAGE_USAGE_STORAGE_BIT,samplesmust beSAMPLE_COUNT_1_BIT - If the
sparse bindings
feature is not enabled,
flagsmust not containIMAGE_CREATE_SPARSE_BINDING_BIT - If the
sparse aliased residency
feature is not enabled,
flagsmust not containIMAGE_CREATE_SPARSE_ALIASED_BIT - If
tilingisIMAGE_TILING_LINEAR,flagsmust not containIMAGE_CREATE_SPARSE_RESIDENCY_BIT - If
imageTypeisIMAGE_TYPE_1D,flagsmust not containIMAGE_CREATE_SPARSE_RESIDENCY_BIT - If the
sparse residency for 2D images
feature is not enabled, and
imageTypeisIMAGE_TYPE_2D,flagsmust not containIMAGE_CREATE_SPARSE_RESIDENCY_BIT - If the
sparse residency for 3D images
feature is not enabled, and
imageTypeisIMAGE_TYPE_3D,flagsmust not containIMAGE_CREATE_SPARSE_RESIDENCY_BIT - If the
sparse residency for images with 2 samples
feature is not enabled,
imageTypeisIMAGE_TYPE_2D, andsamplesisSAMPLE_COUNT_2_BIT,flagsmust not containIMAGE_CREATE_SPARSE_RESIDENCY_BIT - If the
sparse residency for images with 4 samples
feature is not enabled,
imageTypeisIMAGE_TYPE_2D, andsamplesisSAMPLE_COUNT_4_BIT,flagsmust not containIMAGE_CREATE_SPARSE_RESIDENCY_BIT - If the
sparse residency for images with 8 samples
feature is not enabled,
imageTypeisIMAGE_TYPE_2D, andsamplesisSAMPLE_COUNT_8_BIT,flagsmust not containIMAGE_CREATE_SPARSE_RESIDENCY_BIT - If the
sparse residency for images with 16 samples
feature is not enabled,
imageTypeisIMAGE_TYPE_2D, andsamplesisSAMPLE_COUNT_16_BIT,flagsmust not containIMAGE_CREATE_SPARSE_RESIDENCY_BIT - If
flagscontainsIMAGE_CREATE_SPARSE_RESIDENCY_BITorIMAGE_CREATE_SPARSE_ALIASED_BIT, it must also containIMAGE_CREATE_SPARSE_BINDING_BIT - If any of the bits
IMAGE_CREATE_SPARSE_BINDING_BIT,IMAGE_CREATE_SPARSE_RESIDENCY_BIT, orIMAGE_CREATE_SPARSE_ALIASED_BITare set,IMAGE_USAGE_TRANSIENT_ATTACHMENT_BITmust not also be set - If the protected memory feature is not enabled,
flagsmust not containIMAGE_CREATE_PROTECTED_BIT - If any of the bits
IMAGE_CREATE_SPARSE_BINDING_BIT,IMAGE_CREATE_SPARSE_RESIDENCY_BIT, orIMAGE_CREATE_SPARSE_ALIASED_BITare set,IMAGE_CREATE_PROTECTED_BITmust not also be set - If the
pNextchain includes aExternalMemoryImageCreateInfoNVstructure, it must not contain aExternalMemoryImageCreateInfostructure - If the
pNextchain includes aExternalMemoryImageCreateInfostructure, itshandleTypesmember must only contain bits that are also inExternalImageFormatProperties::externalMemoryProperties.compatibleHandleTypes, as returned bygetPhysicalDeviceImageFormatProperties2withformat,imageType,tiling,usage, andflagsequal to those in this structure, and with aPhysicalDeviceExternalImageFormatInfostructure included in thepNextchain, with ahandleTypeequal to any one of the handle types specified inExternalMemoryImageCreateInfo::handleTypes - If the
pNextchain includes aExternalMemoryImageCreateInfoNVstructure, itshandleTypesmember must only contain bits that are also inExternalImageFormatPropertiesNV::externalMemoryProperties.compatibleHandleTypes, as returned bygetPhysicalDeviceExternalImageFormatPropertiesNVwithformat,imageType,tiling,usage, andflagsequal to those in this structure, and withexternalHandleTypeequal to any one of the handle types specified inExternalMemoryImageCreateInfoNV::handleTypes - If the logical device was created with
DeviceGroupDeviceCreateInfo::physicalDeviceCountequal to 1,flagsmust not containIMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT - If
flagscontainsIMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT, thenmipLevelsmust be one,arrayLayersmust be one,imageTypemust beIMAGE_TYPE_2D. andimageCreateMaybeLinear(as defined in Image Creation Limits) must befalse - If
flagscontainsIMAGE_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
flagscontainsIMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT, thenflagsmust also containIMAGE_CREATE_MUTABLE_FORMAT_BIT initialLayoutmust beIMAGE_LAYOUT_UNDEFINEDorIMAGE_LAYOUT_PREINITIALIZED- If the
pNextchain includes aExternalMemoryImageCreateInfoorExternalMemoryImageCreateInfoNVstructure whosehandleTypesmember is not0,initialLayoutmust beIMAGE_LAYOUT_UNDEFINED - If the image
formatis one of those listed in https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion, thenmipLevelsmust be 1 - If the image
formatis one of those listed in https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion,samplesmust beSAMPLE_COUNT_1_BIT - If the image
formatis one of those listed in https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion,imageTypemust beIMAGE_TYPE_2D - If the image
formatis one of those listed in https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion, and theycbcrImageArraysfeature is not enabled,arrayLayersmust be 1 - If
formatis a multi-planar format, and ifimageCreateFormatFeatures(as defined in Image Creation Limits) does not containFORMAT_FEATURE_DISJOINT_BIT, thenflagsmust not containIMAGE_CREATE_DISJOINT_BIT - If
formatis not a multi-planar format, andflagsdoes not includeIMAGE_CREATE_ALIAS_BIT,flagsmust not containIMAGE_CREATE_DISJOINT_BIT - If
tilingisIMAGE_TILING_DRM_FORMAT_MODIFIER_EXT, then thepNextchain must include exactly one ofImageDrmFormatModifierListCreateInfoEXTorImageDrmFormatModifierExplicitCreateInfoEXTstructures - If the
pNextchain includes aImageDrmFormatModifierListCreateInfoEXTorImageDrmFormatModifierExplicitCreateInfoEXTstructure, thentilingmust beIMAGE_TILING_DRM_FORMAT_MODIFIER_EXT - If
tilingisIMAGE_TILING_DRM_FORMAT_MODIFIER_EXTandflagscontainsIMAGE_CREATE_MUTABLE_FORMAT_BIT, then thepNextchain must include aImageFormatListCreateInfostructure with non-zeroviewFormatCount - If
flagscontainsIMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXTformatmust be a depth or depth/stencil format - If the
pNextchain includes aExternalMemoryImageCreateInfostructure whosehandleTypesmember includesEXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID,imageTypemust beIMAGE_TYPE_2D - If the
pNextchain includes aExternalMemoryImageCreateInfostructure whosehandleTypesmember includesEXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID,mipLevelsmust either be1or equal to the number of levels in the complete mipmap chain based onextent.width,extent.height, andextent.depth - If the
pNextchain includes aExternalFormatANDROIDstructure whoseexternalFormatmember is not0,flagsmust not includeIMAGE_CREATE_MUTABLE_FORMAT_BIT - If the
pNextchain includes aExternalFormatANDROIDstructure whoseexternalFormatmember is not0,usagemust not include any usages exceptIMAGE_USAGE_SAMPLED_BIT - If the
pNextchain includes aExternalFormatANDROIDstructure whoseexternalFormatmember is not0,tilingmust beIMAGE_TILING_OPTIMAL - If
formatis a depth-stencil format,usageincludesIMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, and thepNextchain includes aImageStencilUsageCreateInfostructure, then itsImageStencilUsageCreateInfo::stencilUsagemember must also includeIMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT - If
formatis a depth-stencil format,usagedoes not includeIMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, and thepNextchain includes aImageStencilUsageCreateInfostructure, then itsImageStencilUsageCreateInfo::stencilUsagemember must also not includeIMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT - If
formatis a depth-stencil format,usageincludesIMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT, and thepNextchain includes aImageStencilUsageCreateInfostructure, then itsImageStencilUsageCreateInfo::stencilUsagemember must also includeIMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT - If
formatis a depth-stencil format,usagedoes not includeIMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT, and thepNextchain includes aImageStencilUsageCreateInfostructure, then itsImageStencilUsageCreateInfo::stencilUsagemember must also not includeIMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT - If
Formatis a depth-stencil format and thepNextchain includes aImageStencilUsageCreateInfostructure with itsstencilUsagemember includingIMAGE_USAGE_INPUT_ATTACHMENT_BIT,extent.widthmust be less than or equal toPhysicalDeviceLimits::maxFramebufferWidth - If
formatis a depth-stencil format and thepNextchain includes aImageStencilUsageCreateInfostructure with itsstencilUsagemember includingIMAGE_USAGE_INPUT_ATTACHMENT_BIT,extent.heightmust be less than or equal toPhysicalDeviceLimits::maxFramebufferHeight - If the
multisampled storage images
feature is not enabled,
formatis a depth-stencil format and thepNextchain includes aImageStencilUsageCreateInfostructure with itsstencilUsageincludingIMAGE_USAGE_STORAGE_BIT,samplesmust beSAMPLE_COUNT_1_BIT - If
flagscontainsIMAGE_CREATE_CORNER_SAMPLED_BIT_NV,imageTypemust beIMAGE_TYPE_2DorIMAGE_TYPE_3D - If
flagscontainsIMAGE_CREATE_CORNER_SAMPLED_BIT_NV, it must not containIMAGE_CREATE_CUBE_COMPATIBLE_BITand theformatmust not be a depth/stencil format - If
flagscontainsIMAGE_CREATE_CORNER_SAMPLED_BIT_NVandimageTypeisIMAGE_TYPE_2D,extent.widthandextent.heightmust be greater than1 - If
flagscontainsIMAGE_CREATE_CORNER_SAMPLED_BIT_NVandimageTypeisIMAGE_TYPE_3D,extent.width,extent.height, andextent.depthmust be greater than1 - If
usageincludesIMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV,imageTypemust beIMAGE_TYPE_2D - If
usageincludesIMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV,samplesmust beSAMPLE_COUNT_1_BIT - If
usageincludesIMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV,tilingmust beIMAGE_TILING_OPTIMAL - If
flagscontainsIMAGE_CREATE_SUBSAMPLED_BIT_EXT,tilingmust beIMAGE_TILING_OPTIMAL - If
flagscontainsIMAGE_CREATE_SUBSAMPLED_BIT_EXT,imageTypemust beIMAGE_TYPE_2D - If
flagscontainsIMAGE_CREATE_SUBSAMPLED_BIT_EXT,flagsmust not containIMAGE_CREATE_CUBE_COMPATIBLE_BIT - If
flagscontainsIMAGE_CREATE_SUBSAMPLED_BIT_EXT,mipLevelsmust be1
Valid Usage (Implicit)
sTypemust beSTRUCTURE_TYPE_IMAGE_CREATE_INFO
- Each
pNextmember of any structure (including this one) in thepNextchain must be eitherNULLor a pointer to a valid instance ofDedicatedAllocationImageCreateInfoNV,ExternalFormatANDROID,ExternalMemoryImageCreateInfo,ExternalMemoryImageCreateInfoNV,ImageDrmFormatModifierExplicitCreateInfoEXT,ImageDrmFormatModifierListCreateInfoEXT,ImageFormatListCreateInfo,ImageStencilUsageCreateInfo, orImageSwapchainCreateInfoKHR - The
sTypevalue of each struct in thepNextchain must be unique flagsmust be a valid combination ofImageCreateFlagBitsvaluesimageTypemust be a validImageTypevalueformatmust be a validFormatvaluesamplesmust be a validSampleCountFlagBitsvaluetilingmust be a validImageTilingvalueusagemust be a valid combination ofImageUsageFlagBitsvaluesusagemust not be0sharingModemust be a validSharingModevalueinitialLayoutmust be a validImageLayoutvalue
</section> = See Also
Extent3D,
Format,
ImageCreateFlags,
ImageLayout,
ImageTiling,
ImageType,
ImageUsageFlags,
SampleCountFlagBits,
SharingMode,
StructureType, createImage
Constructors
| ImageCreateInfo | |
Fields
| |
Instances
data SubresourceLayout Source #
VkSubresourceLayout - Structure specifying subresource layout
Description
If the image is
linear,
then 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;
The value of arrayPitch is undefined for images that were not created
as arrays. depthPitch is defined only for 3D images.
If the image has a single-plane color format and its tiling is
IMAGE_TILING_LINEAR , then the
aspectMask member of
ImageSubresource must
be IMAGE_ASPECT_COLOR_BIT.
If the image has a depth/stencil format and its tiling is
IMAGE_TILING_LINEAR , then
aspectMask must be either
IMAGE_ASPECT_DEPTH_BIT or
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.
If the image has a
multi-planar format
and its tiling is IMAGE_TILING_LINEAR
, then the aspectMask member of
ImageSubresource must
be IMAGE_ASPECT_PLANE_0_BIT,
IMAGE_ASPECT_PLANE_1_BIT, or
(for 3-plane formats only)
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. If the image is disjoint, then the offset is relative to the
base address of the plane. If the image is non-disjoint, then the
offset is relative to the base address of the image.
If the image’s tiling is
IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT,
then the aspectMask member of
ImageSubresource must
be one of VK_IMAGE_ASPECT_MEMORY_PLANE_i_BIT_EXT, where the maximum
allowed plane index i is defined by the
DrmFormatModifierPropertiesEXT::drmFormatModifierPlaneCount
associated with the image’s ImageCreateInfo::format and
modifier.
The memory range used by the subresource is described by offset and
size. If the image is disjoint, then the offset is relative to the
base address of the memory plane. If the image is non-disjoint, then
the offset is relative to the base address of the image. If the image
is
non-linear,
then rowPitch, arrayPitch, and depthPitch have an
implementation-dependent meaning.
See Also
DeviceSize,
ImageDrmFormatModifierExplicitCreateInfoEXT,
getImageSubresourceLayout
Constructors
| SubresourceLayout | |
Fields
| |
Instances
VkImage - Opaque handle to an image object
See Also
BindImageMemoryInfo,
DedicatedAllocationMemoryAllocateInfoNV,
ImageMemoryBarrier,
ImageMemoryRequirementsInfo2,
ImageSparseMemoryRequirementsInfo2,
ImageViewCreateInfo,
MemoryDedicatedAllocateInfo,
SparseImageMemoryBindInfo,
SparseImageOpaqueMemoryBindInfo,
bindImageMemory,
cmdBlitImage,
cmdClearColorImage,
cmdClearDepthStencilImage,
cmdCopyBufferToImage,
cmdCopyImage,
cmdCopyImageToBuffer,
cmdResolveImage,
createImage, destroyImage,
getImageDrmFormatModifierPropertiesEXT,
getImageMemoryRequirements,
getImageSparseMemoryRequirements,
getImageSubresourceLayout,
getSwapchainImagesKHR
Instances
| Eq Image Source # | |
| Ord Image Source # | |
| Show Image Source # | |
| Storable Image Source # | |
| Zero Image Source # | |
Defined in Vulkan.Core10.Handles | |
| HasObjectType Image Source # | |
Defined in Vulkan.Core10.Handles Methods objectTypeAndHandle :: Image -> (ObjectType, Word64) Source # | |
| IsHandle Image Source # | |
Defined in Vulkan.Core10.Handles | |
newtype ImageLayout Source #
VkImageLayout - Layout of image and image subresources
Description
The type(s) of device access supported by each layout are:
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
https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#clears
and
https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#copies).
For use as a framebuffer attachment, this is a member in the
substructures of the RenderPassCreateInfo (see
Render Pass).
For use in a descriptor set, this is a member in the
DescriptorImageInfo structure (see
https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#descriptorsets-updates).
See Also
AttachmentDescription,
AttachmentDescription2,
AttachmentDescriptionStencilLayout,
AttachmentReference,
AttachmentReference2,
AttachmentReferenceStencilLayout,
DescriptorImageInfo,
ImageCreateInfo,
ImageMemoryBarrier,
cmdBindShadingRateImageNV,
cmdBlitImage,
cmdClearColorImage,
cmdClearDepthStencilImage,
cmdCopyBufferToImage,
cmdCopyImage,
cmdCopyImageToBuffer,
cmdResolveImage
Constructors
| ImageLayout Int32 |
Bundled Patterns
| pattern IMAGE_LAYOUT_UNDEFINED :: ImageLayout |
|
| pattern IMAGE_LAYOUT_GENERAL :: ImageLayout |
|
| pattern IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL :: ImageLayout |
|
| pattern IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL :: ImageLayout |
|
| pattern IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL :: ImageLayout |
|
| pattern IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL :: ImageLayout |
|
| pattern IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL :: ImageLayout |
|
| pattern IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL :: ImageLayout |
|
| pattern IMAGE_LAYOUT_PREINITIALIZED :: ImageLayout |
|
| pattern IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT :: ImageLayout |
|
| pattern IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV :: ImageLayout |
|
| pattern IMAGE_LAYOUT_SHARED_PRESENT_KHR :: ImageLayout |
|
| pattern IMAGE_LAYOUT_PRESENT_SRC_KHR :: ImageLayout |
|
| pattern IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL :: ImageLayout |
|
| pattern IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL :: ImageLayout |
|
| pattern IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL :: ImageLayout |
|
| pattern IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL :: ImageLayout |
|
| pattern IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL :: ImageLayout |
|
| pattern IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL :: ImageLayout |
|