| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Vulkan.Core10.ImageView
Synopsis
- createImageView :: forall a io. (Extendss ImageViewCreateInfo a, PokeChain a, MonadIO io) => Device -> ImageViewCreateInfo a -> ("allocator" ::: Maybe AllocationCallbacks) -> io ImageView
- withImageView :: forall a io r. (Extendss ImageViewCreateInfo a, PokeChain a, MonadIO io) => Device -> ImageViewCreateInfo a -> Maybe AllocationCallbacks -> (io ImageView -> (ImageView -> io ()) -> r) -> r
- destroyImageView :: forall io. MonadIO io => Device -> ImageView -> ("allocator" ::: Maybe AllocationCallbacks) -> io ()
- data ComponentMapping = ComponentMapping {}
- data ImageViewCreateInfo (es :: [Type]) = ImageViewCreateInfo {}
Documentation
createImageView :: forall a io. (Extendss ImageViewCreateInfo a, PokeChain a, MonadIO io) => Device -> ImageViewCreateInfo a -> ("allocator" ::: Maybe AllocationCallbacks) -> io ImageView Source #
vkCreateImageView - Create an image view from an existing image
Parameters
deviceis the logical device that creates the image view.
pCreateInfois a pointer to aImageViewCreateInfostructure containing parameters to be used to create the image view.pAllocatorcontrols host memory allocation as described in the Memory Allocation chapter.pViewis a pointer to aImageViewhandle in which the resulting image view object is returned.
Valid Usage (Implicit)
devicemust be a validDevicehandle
pCreateInfomust be a valid pointer to a validImageViewCreateInfostructure- If
pAllocatoris notNULL,pAllocatormust be a valid pointer to a validAllocationCallbacksstructure pViewmust be a valid pointer to aImageViewhandle
Return Codes
See Also
withImageView :: forall a io r. (Extendss ImageViewCreateInfo a, PokeChain a, MonadIO io) => Device -> ImageViewCreateInfo a -> Maybe AllocationCallbacks -> (io ImageView -> (ImageView -> io ()) -> r) -> r Source #
A convenience wrapper to make a compatible pair of calls to
createImageView and destroyImageView
To ensure that destroyImageView 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.
destroyImageView :: forall io. MonadIO io => Device -> ImageView -> ("allocator" ::: Maybe AllocationCallbacks) -> io () Source #
vkDestroyImageView - Destroy an image view object
Parameters
deviceis the logical device that destroys the image view.
imageViewis the image view to destroy.pAllocatorcontrols host memory allocation as described in the Memory Allocation chapter.
Valid Usage
- All submitted commands that refer to
imageViewmust have completed execution
- If
AllocationCallbackswere provided whenimageViewwas created, a compatible set of callbacks must be provided here - If no
AllocationCallbackswere provided whenimageViewwas created,pAllocatormust beNULL
Valid Usage (Implicit)
devicemust be a validDevicehandle
- If
imageViewis notNULL_HANDLE,imageViewmust be a validImageViewhandle - If
pAllocatoris notNULL,pAllocatormust be a valid pointer to a validAllocationCallbacksstructure - If
imageViewis a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
imageViewmust be externally synchronized
See Also
data ComponentMapping Source #
VkComponentMapping - Structure specifying a color component mapping
Valid Usage (Implicit)
See Also
AndroidHardwareBufferFormatPropertiesANDROID,
ComponentSwizzle,
ImageViewCreateInfo,
SamplerYcbcrConversionCreateInfo
Constructors
| ComponentMapping | |
Fields
| |
Instances
data ImageViewCreateInfo (es :: [Type]) Source #
VkImageViewCreateInfo - Structure specifying parameters of a newly created image view
Description
Some of the image creation parameters are inherited by the view. In
particular, image view creation inherits the implicit parameter usage
specifying the allowed usages of the image view that, by default, takes
the value of the corresponding usage parameter specified in
ImageCreateInfo at image creation time. If the
image was has a depth-stencil format and was created with a
ImageStencilUsageCreateInfo
structure included in the pNext chain of
ImageCreateInfo, the usage is calculated based on
the subresource.aspectMask provided:
- If
aspectMaskincludes onlyIMAGE_ASPECT_STENCIL_BIT, the implicitusageis equal toImageStencilUsageCreateInfo::stencilUsage. - If
aspectMaskincludes onlyIMAGE_ASPECT_DEPTH_BIT, the implicitusageis equal toImageCreateInfo::usage. - If both aspects are included in
aspectMask, the implicitusageis equal to the intersection ofImageCreateInfo::usageandImageStencilUsageCreateInfo::stencilUsage. The implicitusagecan be overriden by adding aImageViewUsageCreateInfostructure to thepNextchain.
If image was created with the
IMAGE_CREATE_MUTABLE_FORMAT_BIT
flag, and if the format of the image is not
multi-planar,
format can be different from the image’s format, but if image was
created without the
IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT
flag and they are not equal they must be compatible. Image format
compatibility is defined in the
Format Compatibility Classes
section. Views of compatible formats will have the same mapping between
texel coordinates and memory locations irrespective of the format,
with only the interpretation of the bit pattern changing.
Note
Values intended to be used with one view format may not be exactly preserved when written or read through a different format. For example, an integer value that happens to have the bit pattern of a floating point denorm or NaN may be flushed or canonicalized when written or read through a view with a floating point format. Similarly, a value written through a signed normalized format that has a bit pattern exactly equal to -2b may be changed to -2b + 1 as described in Conversion from Normalized Fixed-Point to Floating-Point.
If image was created with the
IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT
flag, format must be compatible with the image’s format as
described above, or must be an uncompressed format in which case it
must be size-compatible with the image’s format, as defined for
copying data between images
In this case the resulting image view’s texel dimensions equal the
dimensions of the selected mip level divided by the compressed texel
block size and rounded up.
If the image view is to be used with a sampler which supports
sampler Y′CBCR conversion,
an identically defined object of type
SamplerYcbcrConversion to that used to create
the sampler must be passed to createImageView in a
SamplerYcbcrConversionInfo
included in the pNext chain of ImageViewCreateInfo. Conversely, if a
SamplerYcbcrConversion object is passed to
createImageView, an identically defined
SamplerYcbcrConversion object must be used
when sampling the image.
If the image has a
multi-planar
format and subresourceRange.aspectMask is
IMAGE_ASPECT_COLOR_BIT,
format must be identical to the image format, and the sampler to
be used with the image view must enable
sampler Y′CBCR conversion.
If image was created with the
IMAGE_CREATE_MUTABLE_FORMAT_BIT
and the image has a
multi-planar
format, and if subresourceRange.aspectMask is
IMAGE_ASPECT_PLANE_0_BIT,
IMAGE_ASPECT_PLANE_1_BIT, or
IMAGE_ASPECT_PLANE_2_BIT,
format must be
compatible
with the corresponding plane of the image, and the sampler to be used
with the image view must not enable
sampler Y′CBCR conversion.
The width and height of the single-plane image view must be
derived from the multi-planar image’s dimensions in the manner listed
for
plane compatibility
for the plane.
Any view of an image plane will have the same mapping between texel coordinates and memory locations as used by the channels of the color aspect, subject to the formulae relating texel coordinates to lower-resolution planes as described in Chroma Reconstruction. That is, if an R or B plane has a reduced resolution relative to the G plane of the multi-planar image, the image view operates using the (uplane, vplane) unnormalized coordinates of the reduced-resolution plane, and these coordinates access the same memory locations as the (ucolor, vcolor) unnormalized coordinates of the color aspect for which chroma reconstruction operations operate on the same (uplane, vplane) or (iplane, jplane) coordinates.
| Dim, Arrayed, MS | Image parameters | View parameters |
|---|---|---|
imageType = ci.imageType
width = ci.extent.width
height = ci.extent.height
depth = ci.extent.depth
arrayLayers = ci.arrayLayers
samples = ci.samples
flags = ci.flags
where ci is the ImageCreateInfo used to create image. | baseArrayLayer, layerCount, and levelCount are members
of the subresourceRange member.
| |
| __1D, 0, 0__ | imageType = IMAGE_TYPE_1D
width ≥ 1
height = 1
depth = 1
arrayLayers ≥ 1
samples = 1 | viewType =
IMAGE_VIEW_TYPE_1D
baseArrayLayer ≥ 0
layerCount = 1
|
| __1D, 1, 0__ | imageType = IMAGE_TYPE_1D
width ≥ 1
height = 1
depth = 1
arrayLayers ≥ 1
samples = 1 | viewType =
IMAGE_VIEW_TYPE_1D_ARRAY
baseArrayLayer ≥ 0
layerCount ≥ 1
|
| __2D, 0, 0__ | imageType = IMAGE_TYPE_2D
width ≥ 1
height ≥ 1
depth = 1
arrayLayers ≥ 1
samples = 1 | viewType =
IMAGE_VIEW_TYPE_2D
baseArrayLayer ≥ 0
layerCount = 1
|
| __2D, 1, 0__ | imageType = IMAGE_TYPE_2D
width ≥ 1
height ≥ 1
depth = 1
arrayLayers ≥ 1
samples = 1 | viewType =
IMAGE_VIEW_TYPE_2D_ARRAY
baseArrayLayer ≥ 0
layerCount ≥ 1
|
| __2D, 0, 1__ | imageType = IMAGE_TYPE_2D
width ≥ 1
height ≥ 1
depth = 1
arrayLayers ≥ 1
samples > 1 | viewType =
IMAGE_VIEW_TYPE_2D
baseArrayLayer ≥ 0
layerCount = 1
|
| __2D, 1, 1__ | imageType = IMAGE_TYPE_2D
width ≥ 1
height ≥ 1
depth = 1
arrayLayers ≥ 1
samples > 1 | viewType =
IMAGE_VIEW_TYPE_2D_ARRAY
baseArrayLayer ≥ 0
layerCount ≥ 1
|
| __CUBE, 0, 0__ | imageType = IMAGE_TYPE_2D
width ≥ 1
height = width
depth = 1
arrayLayers ≥ 6
samples = 1
flags includes
IMAGE_CREATE_CUBE_COMPATIBLE_BIT | viewType =
IMAGE_VIEW_TYPE_CUBE
baseArrayLayer ≥ 0
layerCount = 6
|
| __CUBE, 1, 0__ | imageType = IMAGE_TYPE_2D
width ≥ 1
height = width
depth = 1
N ≥ 1
arrayLayers ≥ 6 × N
samples = 1
flags includes
IMAGE_CREATE_CUBE_COMPATIBLE_BIT | viewType =
IMAGE_VIEW_TYPE_CUBE_ARRAY
baseArrayLayer ≥ 0
layerCount = 6 × N, N ≥ 1
|
| __3D, 0, 0__ | imageType = IMAGE_TYPE_3D
width ≥ 1
height ≥ 1
depth ≥ 1
arrayLayers = 1
samples = 1 | viewType =
IMAGE_VIEW_TYPE_3D
baseArrayLayer = 0
layerCount = 1
|
| __3D, 0, 0__ | imageType = IMAGE_TYPE_3D
width ≥ 1
height ≥ 1
depth ≥ 1
arrayLayers = 1
samples = 1
flags includes
IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT
flags does not include
IMAGE_CREATE_SPARSE_BINDING_BIT,
IMAGE_CREATE_SPARSE_RESIDENCY_BIT,
and IMAGE_CREATE_SPARSE_ALIASED_BIT | viewType =
IMAGE_VIEW_TYPE_2D
levelCount = 1
baseArrayLayer ≥ 0
layerCount = 1
|
| __3D, 0, 0__ | imageType = IMAGE_TYPE_3D
width ≥ 1
height ≥ 1
depth ≥ 1
arrayLayers = 1
samples = 1
flags includes
IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT
flags does not include
IMAGE_CREATE_SPARSE_BINDING_BIT,
IMAGE_CREATE_SPARSE_RESIDENCY_BIT,
and IMAGE_CREATE_SPARSE_ALIASED_BIT | viewType =
IMAGE_VIEW_TYPE_2D_ARRAY
levelCount = 1
baseArrayLayer ≥ 0
layerCount ≥ 1
|
Image and image view parameter compatibility requirements
Valid Usage
- If
imagewas not created withIMAGE_CREATE_CUBE_COMPATIBLE_BITthenviewTypemust not beIMAGE_VIEW_TYPE_CUBEorIMAGE_VIEW_TYPE_CUBE_ARRAY
- If the
image cubemap arrays
feature is not enabled,
viewTypemust not beIMAGE_VIEW_TYPE_CUBE_ARRAY - If
imagewas created withIMAGE_TYPE_3Dbut withoutIMAGE_CREATE_2D_ARRAY_COMPATIBLE_BITset thenviewTypemust not beIMAGE_VIEW_TYPE_2DorIMAGE_VIEW_TYPE_2D_ARRAY imagemust have been created with ausagevalue containing at least one ofIMAGE_USAGE_SAMPLED_BIT,IMAGE_USAGE_STORAGE_BIT,IMAGE_USAGE_COLOR_ATTACHMENT_BIT,IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT,IMAGE_USAGE_INPUT_ATTACHMENT_BIT,IMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV, orIMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT- The format features of the resultant image view must contain at least one bit
- If
usagecontainsIMAGE_USAGE_SAMPLED_BIT, then the format features of the resultant image view must containFORMAT_FEATURE_SAMPLED_IMAGE_BIT - If
usagecontainsIMAGE_USAGE_STORAGE_BIT, then the image view’s format features must containFORMAT_FEATURE_STORAGE_IMAGE_BIT - If
usagecontainsIMAGE_USAGE_COLOR_ATTACHMENT_BIT, then the image view’s format features must containFORMAT_FEATURE_COLOR_ATTACHMENT_BIT - If
usagecontainsIMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, then the image view’s format features must containFORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT - If
usagecontainsIMAGE_USAGE_INPUT_ATTACHMENT_BIT, then the image view’s format features must contain at least one ofFORMAT_FEATURE_COLOR_ATTACHMENT_BITorFORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT subresourceRange.baseMipLevelmust be less than themipLevelsspecified inImageCreateInfowhenimagewas created- If
subresourceRange.levelCountis notREMAINING_MIP_LEVELS,subresourceRange.baseMipLevel+subresourceRange.levelCountmust be less than or equal to themipLevelsspecified inImageCreateInfowhenimagewas created - If
imagewas created withusagecontainingIMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT,subresourceRange.levelCountmust be1 - If
imageis not a 3D image created withIMAGE_CREATE_2D_ARRAY_COMPATIBLE_BITset, orviewTypeis notIMAGE_VIEW_TYPE_2DorIMAGE_VIEW_TYPE_2D_ARRAY,subresourceRange.baseArrayLayermust be less than thearrayLayersspecified inImageCreateInfowhenimagewas created - If
subresourceRange.layerCountis notREMAINING_ARRAY_LAYERS,imageis not a 3D image created withIMAGE_CREATE_2D_ARRAY_COMPATIBLE_BITset, orviewTypeis notIMAGE_VIEW_TYPE_2DorIMAGE_VIEW_TYPE_2D_ARRAY,subresourceRange.layerCountmust be non-zero andsubresourceRange.baseArrayLayer+subresourceRange.layerCountmust be less than or equal to thearrayLayersspecified inImageCreateInfowhenimagewas created - If
imageis a 3D image created withIMAGE_CREATE_2D_ARRAY_COMPATIBLE_BITset, andviewTypeisIMAGE_VIEW_TYPE_2DorIMAGE_VIEW_TYPE_2D_ARRAY,subresourceRange.baseArrayLayermust be less than the depth computed frombaseMipLevelandextent.depthspecified inImageCreateInfowhenimagewas created, according to the formula defined in Image Miplevel Sizing - If
subresourceRange.layerCountis notREMAINING_ARRAY_LAYERS,imageis a 3D image created withIMAGE_CREATE_2D_ARRAY_COMPATIBLE_BITset, andviewTypeisIMAGE_VIEW_TYPE_2DorIMAGE_VIEW_TYPE_2D_ARRAY,subresourceRange.layerCountmust be non-zero andsubresourceRange.baseArrayLayer+subresourceRange.layerCountmust be less than or equal to the depth computed frombaseMipLevelandextent.depthspecified inImageCreateInfowhenimagewas created, according to the formula defined in Image Miplevel Sizing - If
imagewas created with theIMAGE_CREATE_MUTABLE_FORMAT_BITflag, but without theIMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BITflag, and if theformatof theimageis not a multi-planar format,formatmust be compatible with theformatused to createimage, as defined in Format Compatibility Classes - If
imagewas created with theIMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BITflag,formatmust be compatible with, or must be an uncompressed format that is size-compatible with, theformatused to createimage - If
imagewas created with theIMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BITflag, thelevelCountandlayerCountmembers ofsubresourceRangemust both be1 - If a
ImageFormatListCreateInfostructure was included in thepNextchain of theImageCreateInfostructure used when creatingimageand theviewFormatCountfield ofImageFormatListCreateInfois not zero thenformatmust be one of the formats inImageFormatListCreateInfo::pViewFormats - If
imagewas created with theIMAGE_CREATE_MUTABLE_FORMAT_BITflag, if theformatof theimageis a multi-planar format, and ifsubresourceRange.aspectMaskis one ofIMAGE_ASPECT_PLANE_0_BIT,IMAGE_ASPECT_PLANE_1_BIT, orIMAGE_ASPECT_PLANE_2_BIT, thenformatmust be compatible with theFormatfor the plane of theimageformatindicated bysubresourceRange.aspectMask, as defined in https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-compatible-planes - If
imagewas not created with theIMAGE_CREATE_MUTABLE_FORMAT_BITflag, or if theformatof theimageis a multi-planar format and ifsubresourceRange.aspectMaskisIMAGE_ASPECT_COLOR_BIT,formatmust be identical to theformatused to createimage - If the
pNextchain includes aSamplerYcbcrConversionInfostructure with aconversionvalue other thanNULL_HANDLE, all members ofcomponentsmust have the valueCOMPONENT_SWIZZLE_IDENTITY - If
imageis non-sparse then it must be bound completely and contiguously to a singleDeviceMemoryobject subresourceRangeandviewTypemust be compatible with the image, as described in the compatibility table- If
imagehas an external format,formatmust beFORMAT_UNDEFINED - If
imagehas an external format, thepNextchain must include aSamplerYcbcrConversionInfostructure with aconversionobject created with the same external format asimage - If
imagehas an external format, all members ofcomponentsmust beCOMPONENT_SWIZZLE_IDENTITY - If
imagewas created withusagecontainingIMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV,viewTypemust beIMAGE_VIEW_TYPE_2DorIMAGE_VIEW_TYPE_2D_ARRAY - If
imagewas created withusagecontainingIMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV,formatmust beFORMAT_R8_UINT - If
dynamic fragment density map
feature is not enabled,
flagsmust not containIMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DYNAMIC_BIT_EXT - If
dynamic fragment density map
feature is not enabled and
imagewas created withusagecontainingIMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT,flagsmust not contain any ofIMAGE_CREATE_PROTECTED_BIT,IMAGE_CREATE_SPARSE_BINDING_BIT,IMAGE_CREATE_SPARSE_RESIDENCY_BIT, orIMAGE_CREATE_SPARSE_ALIASED_BIT - If the
pNextchain includes aImageViewUsageCreateInfostructure, andimagewas not created with aImageStencilUsageCreateInfostructure included in thepNextchain ofImageCreateInfo, itsusagemember must not include any bits that were not set in theusagemember of theImageCreateInfostructure used to createimage - If the
pNextchain includes aImageViewUsageCreateInfostructure,imagewas created with aImageStencilUsageCreateInfostructure included in thepNextchain ofImageCreateInfo, andsubResourceRange.aspectMaskincludesIMAGE_ASPECT_STENCIL_BIT, theusagemember of theImageViewUsageCreateInfoinstance must not include any bits that were not set in theusagemember of theImageStencilUsageCreateInfostructure used to createimage - If the
pNextchain includes aImageViewUsageCreateInfostructure,imagewas created with aImageStencilUsageCreateInfostructure included in thepNextchain ofImageCreateInfo, andsubResourceRange.aspectMaskincludes bits other thanIMAGE_ASPECT_STENCIL_BIT, theusagemember of theImageViewUsageCreateInfostructure must not include any bits that were not set in theusagemember of theImageCreateInfostructure used to createimage - If
viewTypeisIMAGE_VIEW_TYPE_CUBEandsubresourceRange.layerCountis notREMAINING_ARRAY_LAYERS,subresourceRange.layerCountmust be6 - If
viewTypeisIMAGE_VIEW_TYPE_CUBE_ARRAYandsubresourceRange.layerCountis notREMAINING_ARRAY_LAYERS,subresourceRange.layerCountmust be a multiple of6 - If
viewTypeisIMAGE_VIEW_TYPE_CUBEandsubresourceRange.layerCountisREMAINING_ARRAY_LAYERS, the remaining number of layers must be6 - If
viewTypeisIMAGE_VIEW_TYPE_CUBE_ARRAYandsubresourceRange.layerCountisREMAINING_ARRAY_LAYERS, the remaining number of layers must be a multiple of6
Valid Usage (Implicit)
sTypemust beSTRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
- Each
pNextmember of any structure (including this one) in thepNextchain must be eitherNULLor a pointer to a valid instance ofImageViewASTCDecodeModeEXT,ImageViewUsageCreateInfo, orSamplerYcbcrConversionInfo - The
sTypevalue of each struct in thepNextchain must be unique flagsmust be a valid combination ofImageViewCreateFlagBitsvaluesimagemust be a validImagehandleviewTypemust be a validImageViewTypevalueformatmust be a validFormatvaluecomponentsmust be a validComponentMappingstructuresubresourceRangemust be a validImageSubresourceRangestructure
See Also
ComponentMapping, Format,
Image,
ImageSubresourceRange,
ImageViewCreateFlags,
ImageViewType,
StructureType, createImageView
Constructors
| ImageViewCreateInfo | |
Fields
| |