vulkan-3.26.1: Bindings to the Vulkan graphics API.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Vulkan.Core10.ImageView

Synopsis

Documentation

createImageView Source #

Arguments

:: forall a io. (Extendss ImageViewCreateInfo a, PokeChain a, MonadIO io) 
=> Device

device is the logical device that creates the image view.

-> ImageViewCreateInfo a

pCreateInfo is a pointer to a ImageViewCreateInfo structure containing parameters to be used to create the image view.

-> ("allocator" ::: Maybe AllocationCallbacks)

pAllocator controls host memory allocation as described in the Memory Allocation chapter.

-> io ImageView 

vkCreateImageView - Create an image view from an existing image

Valid Usage

Valid Usage (Implicit)

  • device must be a valid Device handle

Return Codes

Success
Failure

See Also

VK_VERSION_1_0, AllocationCallbacks, Device, ImageView, ImageViewCreateInfo

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 last argument. To just extract the pair pass (,) as the last argument.

destroyImageView Source #

Arguments

:: forall io. MonadIO io 
=> Device

device is the logical device that destroys the image view.

-> ImageView

imageView is the image view to destroy.

-> ("allocator" ::: Maybe AllocationCallbacks)

pAllocator controls host memory allocation as described in the Memory Allocation chapter.

-> io () 

vkDestroyImageView - Destroy an image view object

Valid Usage

  • All submitted commands that refer to imageView must have completed execution
  • If AllocationCallbacks were provided when imageView was created, a compatible set of callbacks must be provided here
  • If no AllocationCallbacks were provided when imageView was created, pAllocator must be NULL

Valid Usage (Implicit)

  • device must be a valid Device handle
  • If imageView is not NULL_HANDLE, imageView must be a valid ImageView handle
  • If pAllocator is not NULL, pAllocator must be a valid pointer to a valid AllocationCallbacks structure
  • If imageView is a valid handle, it must have been created, allocated, or retrieved from device

Host Synchronization

  • Host access to imageView must be externally synchronized

See Also

VK_VERSION_1_0, AllocationCallbacks, Device, ImageView

data ComponentMapping Source #

Constructors

ComponentMapping 

Fields

Instances

Instances details
Storable ComponentMapping Source # 
Instance details

Defined in Vulkan.Core10.ImageView

Show ComponentMapping Source # 
Instance details

Defined in Vulkan.Core10.ImageView

Eq ComponentMapping Source # 
Instance details

Defined in Vulkan.Core10.ImageView

FromCStruct ComponentMapping Source # 
Instance details

Defined in Vulkan.Core10.ImageView

ToCStruct ComponentMapping Source # 
Instance details

Defined in Vulkan.Core10.ImageView

Zero ComponentMapping Source # 
Instance details

Defined in Vulkan.Core10.ImageView

data ImageSubresourceRange Source #

VkImageSubresourceRange - Structure specifying an image subresource range

Description

The number of mipmap levels and array layers must be a subset of the image subresources in the image. If an application wants to use all mip levels or layers in an image after the baseMipLevel or baseArrayLayer, it can set levelCount and layerCount to the special values REMAINING_MIP_LEVELS and REMAINING_ARRAY_LAYERS without knowing the exact number of mip levels or layers.

For cube and cube array image views, the layers of the image view starting at baseArrayLayer correspond to faces in the order +X, -X, +Y, -Y, +Z, -Z. For cube arrays, each set of six sequential layers is a single cube, so the number of cube maps in a cube map array view is layerCount / 6, and image array layer (baseArrayLayer + i) is face index (i mod 6) of cube i / 6. If the number of layers in the view, whether set explicitly in layerCount or implied by REMAINING_ARRAY_LAYERS, is not a multiple of 6, the last cube map in the array must not be accessed.

aspectMask must be only IMAGE_ASPECT_COLOR_BIT, IMAGE_ASPECT_DEPTH_BIT or IMAGE_ASPECT_STENCIL_BIT if format is a color, depth-only or stencil-only format, respectively, except if format is a multi-planar format. If using a depth/stencil format with both depth and stencil components, aspectMask must include at least one of IMAGE_ASPECT_DEPTH_BIT and IMAGE_ASPECT_STENCIL_BIT, and can include both.

When the ImageSubresourceRange structure is used to select a subset of the slices of a 3D image’s mip level in order to create a 2D or 2D array image view of a 3D image created with IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT, baseArrayLayer and layerCount specify the first slice index and the number of slices to include in the created image view. Such an image view can be used as a framebuffer attachment that refers only to the specified range of slices of the selected mip level. However, any layout transitions performed on such an attachment view during a render pass instance still apply to the entire subresource referenced which includes all the slices of the selected mip level.

When using an image view of a depth/stencil image to populate a descriptor set (e.g. for sampling in the shader, or for use as an input attachment), the aspectMask must only include one bit, which selects whether the image view is used for depth reads (i.e. using a floating-point sampler or input attachment in the shader) or stencil reads (i.e. using an unsigned integer sampler or input attachment in the shader). When an image view of a depth/stencil image is used as a depth/stencil framebuffer attachment, the aspectMask is ignored and both depth and stencil image subresources are used.

When creating a ImageView, if sampler Y′CBCR conversion is enabled in the sampler, the aspectMask of a subresourceRange used by the ImageView must be IMAGE_ASPECT_COLOR_BIT.

When creating a ImageView, if sampler Y′CBCR conversion is not enabled in the sampler and the image format is multi-planar, the image must have been created with IMAGE_CREATE_MUTABLE_FORMAT_BIT, and the aspectMask of the ImageView’s subresourceRange must be IMAGE_ASPECT_PLANE_0_BIT, IMAGE_ASPECT_PLANE_1_BIT or IMAGE_ASPECT_PLANE_2_BIT.

Valid Usage

Valid Usage (Implicit)

  • aspectMask must not be 0

See Also

VK_VERSION_1_0, HostImageLayoutTransitionInfoEXT, ImageAspectFlags, ImageMemoryBarrier, ImageMemoryBarrier2, ImageViewCreateInfo, cmdClearColorImage, cmdClearDepthStencilImage

Constructors

ImageSubresourceRange 

Fields

Instances

Instances details
Storable ImageSubresourceRange Source # 
Instance details

Defined in Vulkan.Core10.ImageView

Show ImageSubresourceRange Source # 
Instance details

Defined in Vulkan.Core10.ImageView

Eq ImageSubresourceRange Source # 
Instance details

Defined in Vulkan.Core10.ImageView

FromCStruct ImageSubresourceRange Source # 
Instance details

Defined in Vulkan.Core10.ImageView

ToCStruct ImageSubresourceRange Source # 
Instance details

Defined in Vulkan.Core10.ImageView

Zero ImageSubresourceRange Source # 
Instance details

Defined in Vulkan.Core10.ImageView

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. The implicit usage can be overridden by adding a ImageViewUsageCreateInfo structure to the pNext chain, but the view usage must be a subset of the image usage. If image 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 image is a 3D image, its Z range can be restricted to a subset by adding a ImageViewSlicedCreateInfoEXT to the pNext chain.

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.

If image was created with a multi-planar format, and the image view’s aspectMask is one of IMAGE_ASPECT_PLANE_0_BIT, IMAGE_ASPECT_PLANE_1_BIT or IMAGE_ASPECT_PLANE_2_BIT, the view’s aspect mask is considered to be equivalent to IMAGE_ASPECT_COLOR_BIT when used as a framebuffer attachment.

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. 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.

The ComponentMapping components member describes a remapping from components of the image to components of the vector returned by shader image instructions. This remapping must be the identity swizzle for storage image descriptors, input attachment descriptors, framebuffer attachments, and any ImageView used with a combined image sampler that enables sampler Y′CBCR conversion.

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, subresourceRange.aspectMask is IMAGE_ASPECT_COLOR_BIT, and usage includes IMAGE_USAGE_SAMPLED_BIT, then the format must be identical to the image format and the sampler to be used with the image view must enable sampler Y′CBCR conversion.

When such an image is used in a video coding operation, the sampler Y′CBCR conversion has no effect.

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 components 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.

Image View TypeCompatible Image Types
IMAGE_VIEW_TYPE_1DIMAGE_TYPE_1D
IMAGE_VIEW_TYPE_1D_ARRAYIMAGE_TYPE_1D
IMAGE_VIEW_TYPE_2D IMAGE_TYPE_2D , IMAGE_TYPE_3D
IMAGE_VIEW_TYPE_2D_ARRAY IMAGE_TYPE_2D , IMAGE_TYPE_3D
IMAGE_VIEW_TYPE_CUBEIMAGE_TYPE_2D
IMAGE_VIEW_TYPE_CUBE_ARRAYIMAGE_TYPE_2D
IMAGE_VIEW_TYPE_3DIMAGE_TYPE_3D

Image type and image view type compatibility requirements

Valid Usage

Valid Usage (Implicit)

See Also

VK_VERSION_1_0, ComponentMapping, Format, Image, ImageSubresourceRange, ImageViewCreateFlags, ImageViewType, StructureType, createImageView

Constructors

ImageViewCreateInfo 

Fields

Instances

Instances details
Extensible ImageViewCreateInfo Source # 
Instance details

Defined in Vulkan.Core10.ImageView

Methods

extensibleTypeName :: String Source #

getNext :: forall (es :: [Type]). ImageViewCreateInfo es -> Chain es Source #

setNext :: forall (ds :: [Type]) (es :: [TYPE LiftedRep]). ImageViewCreateInfo ds -> Chain es -> ImageViewCreateInfo es Source #

extends :: forall e b proxy. Typeable e => proxy e -> (Extends ImageViewCreateInfo e => b) -> Maybe b Source #

Show (Chain es) => Show (ImageViewCreateInfo es) Source # 
Instance details

Defined in Vulkan.Core10.ImageView

(Extendss ImageViewCreateInfo es, PeekChain es) => FromCStruct (ImageViewCreateInfo es) Source # 
Instance details

Defined in Vulkan.Core10.ImageView

(Extendss ImageViewCreateInfo es, PokeChain es) => ToCStruct (ImageViewCreateInfo es) Source # 
Instance details

Defined in Vulkan.Core10.ImageView

es ~ ('[] :: [Type]) => Zero (ImageViewCreateInfo es) Source # 
Instance details

Defined in Vulkan.Core10.ImageView

newtype ImageView Source #

Constructors

ImageView Word64 

Instances

Instances details
Storable ImageView Source # 
Instance details

Defined in Vulkan.Core10.Handles

Show ImageView Source # 
Instance details

Defined in Vulkan.Core10.Handles

Eq ImageView Source # 
Instance details

Defined in Vulkan.Core10.Handles

Ord ImageView Source # 
Instance details

Defined in Vulkan.Core10.Handles

HasObjectType ImageView Source # 
Instance details

Defined in Vulkan.Core10.Handles

IsHandle ImageView Source # 
Instance details

Defined in Vulkan.Core10.Handles

Zero ImageView Source # 
Instance details

Defined in Vulkan.Core10.Handles

newtype ImageViewType Source #

Constructors

ImageViewType Int32 

Instances

Instances details
Storable ImageViewType Source # 
Instance details

Defined in Vulkan.Core10.Enums.ImageViewType

Read ImageViewType Source # 
Instance details

Defined in Vulkan.Core10.Enums.ImageViewType

Show ImageViewType Source # 
Instance details

Defined in Vulkan.Core10.Enums.ImageViewType

Eq ImageViewType Source # 
Instance details

Defined in Vulkan.Core10.Enums.ImageViewType

Ord ImageViewType Source # 
Instance details

Defined in Vulkan.Core10.Enums.ImageViewType

Zero ImageViewType Source # 
Instance details

Defined in Vulkan.Core10.Enums.ImageViewType

newtype ComponentSwizzle Source #

VkComponentSwizzle - Specify how a component is swizzled

Description

Setting the identity swizzle on a component is equivalent to setting the identity mapping on that component. That is:

ComponentIdentity Mapping
components.rCOMPONENT_SWIZZLE_R
components.gCOMPONENT_SWIZZLE_G
components.bCOMPONENT_SWIZZLE_B
components.aCOMPONENT_SWIZZLE_A

Component Mappings Equivalent To COMPONENT_SWIZZLE_IDENTITY

See Also

VK_VERSION_1_0, ComponentMapping

Constructors

ComponentSwizzle Int32 

Bundled Patterns

pattern COMPONENT_SWIZZLE_IDENTITY :: ComponentSwizzle

COMPONENT_SWIZZLE_IDENTITY specifies that the component is set to the identity swizzle.

pattern COMPONENT_SWIZZLE_ZERO :: ComponentSwizzle

COMPONENT_SWIZZLE_ZERO specifies that the component is set to zero.

pattern COMPONENT_SWIZZLE_ONE :: ComponentSwizzle

COMPONENT_SWIZZLE_ONE specifies that the component is set to either 1 or 1.0, depending on whether the type of the image view format is integer or floating-point respectively, as determined by the Format Definition section for each Format.

pattern COMPONENT_SWIZZLE_R :: ComponentSwizzle

COMPONENT_SWIZZLE_R specifies that the component is set to the value of the R component of the image.

pattern COMPONENT_SWIZZLE_G :: ComponentSwizzle

COMPONENT_SWIZZLE_G specifies that the component is set to the value of the G component of the image.

pattern COMPONENT_SWIZZLE_B :: ComponentSwizzle

COMPONENT_SWIZZLE_B specifies that the component is set to the value of the B component of the image.

pattern COMPONENT_SWIZZLE_A :: ComponentSwizzle

COMPONENT_SWIZZLE_A specifies that the component is set to the value of the A component of the image.

Instances

Instances details
Storable ComponentSwizzle Source # 
Instance details

Defined in Vulkan.Core10.Enums.ComponentSwizzle

Read ComponentSwizzle Source # 
Instance details

Defined in Vulkan.Core10.Enums.ComponentSwizzle

Show ComponentSwizzle Source # 
Instance details

Defined in Vulkan.Core10.Enums.ComponentSwizzle

Eq ComponentSwizzle Source # 
Instance details

Defined in Vulkan.Core10.Enums.ComponentSwizzle

Ord ComponentSwizzle Source # 
Instance details

Defined in Vulkan.Core10.Enums.ComponentSwizzle

Zero ComponentSwizzle Source # 
Instance details

Defined in Vulkan.Core10.Enums.ComponentSwizzle

newtype ImageViewCreateFlagBits Source #

VkImageViewCreateFlagBits - Bitmask specifying additional parameters of an image view

See Also

VK_VERSION_1_0, ImageViewCreateFlags

Bundled Patterns

pattern IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DEFERRED_BIT_EXT :: ImageViewCreateFlagBits

IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DEFERRED_BIT_EXT specifies that the fragment density map will be read by the host during endCommandBuffer for the primary command buffer that the render pass is recorded into

pattern IMAGE_VIEW_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT :: ImageViewCreateFlagBits

IMAGE_VIEW_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT specifies that the image view can be used with descriptor buffers when capturing and replaying (e.g. for trace capture and replay), see OpaqueCaptureDescriptorDataCreateInfoEXT for more detail.

pattern IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DYNAMIC_BIT_EXT :: ImageViewCreateFlagBits

IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DYNAMIC_BIT_EXT specifies that the fragment density map will be read by device during PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT

Instances

Instances details
Storable ImageViewCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.ImageViewCreateFlagBits

Bits ImageViewCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.ImageViewCreateFlagBits

FiniteBits ImageViewCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.ImageViewCreateFlagBits

Read ImageViewCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.ImageViewCreateFlagBits

Show ImageViewCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.ImageViewCreateFlagBits

Eq ImageViewCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.ImageViewCreateFlagBits

Ord ImageViewCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.ImageViewCreateFlagBits

Zero ImageViewCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.ImageViewCreateFlagBits