| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Vulkan.Core10.Enums.ImageLayout
Synopsis
- 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_ZERO_INITIALIZED_EXT :: ImageLayout
- pattern IMAGE_LAYOUT_TENSOR_ALIASING_ARM :: ImageLayout
- pattern IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT :: ImageLayout
- pattern IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR :: ImageLayout
- pattern IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT :: ImageLayout
- pattern IMAGE_LAYOUT_SHARED_PRESENT_KHR :: ImageLayout
- pattern IMAGE_LAYOUT_PRESENT_SRC_KHR :: ImageLayout
- pattern IMAGE_LAYOUT_RENDERING_LOCAL_READ :: ImageLayout
- pattern IMAGE_LAYOUT_ATTACHMENT_OPTIMAL :: ImageLayout
- pattern IMAGE_LAYOUT_READ_ONLY_OPTIMAL :: 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
newtype ImageLayout Source #
VkImageLayout - Layout of image and image subresources
Description
The type(s) of device access supported by each layout are:
IMAGE_LAYOUT_UNDEFINEDspecifies that the layout is unknown. Image memory cannot be transitioned into this layout. This layout can be used as theinitialLayoutmember ofImageCreateInfo. This layout can be used in place of the current image layout in a layout transition, but doing so will cause the contents of the image’s memory to be undefined.IMAGE_LAYOUT_PREINITIALIZEDspecifies that an image’s memory is in a defined layout and can be populated by data, but that it has not yet been initialized by the driver. Image memory cannot be transitioned into this layout. This layout can be used as theinitialLayoutmember ofImageCreateInfo. 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,IMAGE_LAYOUT_PREINITIALIZEDis only useful with linear images because there is not a standard layout defined forIMAGE_TILING_OPTIMALimages.IMAGE_LAYOUT_GENERALsupports all types of device access, unless specified otherwise.IMAGE_LAYOUT_ZERO_INITIALIZED_EXTspecifies that an image’s memory is in a defined layout and is zeroed, but that it has not yet been initialized by the driver. Image memory cannot be transitioned into this layout. This layout can be used as theinitialLayoutmember ofImageCreateInfo. This layout is intended to be used as the initial layout for an image whose contents are already zeroed, either from being explicitly set to zero by an application or from being allocated withMEMORY_ALLOCATE_ZERO_INITIALIZE_BIT_EXT.IMAGE_LAYOUT_ATTACHMENT_OPTIMALspecifies a layout that must only be used with attachment accesses in the graphics pipeline.IMAGE_LAYOUT_READ_ONLY_OPTIMALspecifies a layout allowing read only access as an attachment, or in shaders as a sampled image, combined image/sampler, or input attachment.IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMALmust only be used as a color or resolve attachment in aFramebuffer. This layout is valid only for image subresources of images created with theIMAGE_USAGE_COLOR_ATTACHMENT_BITusage flag set.IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMALspecifies a layout for both the depth and stencil aspects of a depth/stencil format image allowing read and write access as a depth/stencil attachment. It is equivalent toIMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMALandIMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL.IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMALspecifies a layout for both the depth and stencil aspects of a depth/stencil format image allowing read only access as a depth/stencil attachment or in shaders as a sampled image, combined image/sampler, or input attachment. It is equivalent toIMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMALandIMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL.IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMALspecifies a layout for depth/stencil format images allowing read and write access to the stencil aspect as a stencil attachment, and read only access to the depth aspect as a depth attachment or in shaders as a sampled image, combined image/sampler, or input attachment. It is equivalent toIMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMALandIMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL.IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMALspecifies a layout for depth/stencil format images allowing read and write access to the depth aspect as a depth attachment, and read only access to the stencil aspect as a stencil attachment or in shaders as a sampled image, combined image/sampler, or input attachment. It is equivalent toIMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMALandIMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL.IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMALspecifies a layout for the depth aspect of a depth/stencil format image allowing read and write access as a depth attachment.IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMALspecifies a layout for the depth aspect of a depth/stencil format image allowing read-only access as a depth attachment or in shaders as a sampled image, combined image/sampler, or input attachment.IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMALspecifies a layout for the stencil aspect of a depth/stencil format image allowing read and write access as a stencil attachment.IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMALspecifies a layout for the stencil aspect of a depth/stencil format image allowing read-only access as a stencil attachment or in shaders as a sampled image, combined image/sampler, or input attachment.IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMALspecifies a layout allowing read-only access in a shader as a sampled image, combined image/sampler, or input attachment. This layout is valid only for image subresources of images created with theIMAGE_USAGE_SAMPLED_BITorIMAGE_USAGE_INPUT_ATTACHMENT_BITusage bits enabled.IMAGE_LAYOUT_TRANSFER_SRC_OPTIMALmust only be used as a source image of a transfer command (see the definition of https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-pipeline-stages-transfer). This layout is valid only for image subresources of images created with theIMAGE_USAGE_TRANSFER_SRC_BITusage flag set.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 theIMAGE_USAGE_TRANSFER_DST_BITusage flag set.IMAGE_LAYOUT_PRESENT_SRC_KHRmust only be used for presenting a presentable image for display.IMAGE_LAYOUT_SHARED_PRESENT_KHRis valid only for shared presentable images, and must be used for any usage the image supports.IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHRmust only be used as a fragment shading rate attachment or shading rate image. This layout is valid only for image subresources of images created with theIMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHRusage flag set.IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXTmust only be used as a fragment density map attachment in aRenderPass. This layout is valid only for image subresources of images created with theIMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXTusage flag set.- VK_IMAGE_LAYOUT_VIDEO_DECODE_DST_KHR must only be used as a decode output picture in a video decode operation. This layout is valid only for image subresources of images created with the VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR usage flag set.
- VK_IMAGE_LAYOUT_VIDEO_DECODE_SRC_KHR is reserved for future use.
- VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR must only be used as an output reconstructed picture or an input reference picture in a video decode operation. This layout is valid only for image subresources of images created with the VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR usage flag set.
- VK_IMAGE_LAYOUT_VIDEO_ENCODE_DST_KHR is reserved for future use.
- VK_IMAGE_LAYOUT_VIDEO_ENCODE_SRC_KHR must only be used as an encode input picture in a video encode operation. This layout is valid only for image subresources of images created with the VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR usage flag set.
- VK_IMAGE_LAYOUT_VIDEO_ENCODE_DPB_KHR must only be used as an output reconstructed picture or an input reference picture in a video encode operation. This layout is valid only for image subresources of images created with the VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR usage flag set.
IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXTmust only be used as either a color attachment or depth/stencil attachment and/or read-only access in a shader as a sampled image, combined image/sampler, or input attachment. This layout is valid only for image subresources of images created with theIMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXTusage flag set, and either theIMAGE_USAGE_COLOR_ATTACHMENT_BITorIMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BITusage flags set, and either theIMAGE_USAGE_INPUT_ATTACHMENT_BITorIMAGE_USAGE_SAMPLED_BITusage flags setIMAGE_LAYOUT_RENDERING_LOCAL_READmust only be used as either a storage image, or a color or depth/stencil attachment and an input attachment. This layout is valid only for image subresources of images created with either theIMAGE_USAGE_STORAGE_BITusage flag set, or both theIMAGE_USAGE_INPUT_ATTACHMENT_BITand either of theIMAGE_USAGE_COLOR_ATTACHMENT_BITorIMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BITusage flags set.- VK_IMAGE_LAYOUT_VIDEO_ENCODE_QUANTIZATION_MAP_KHR must only be used as a quantization map in a video encode operation. This layout is valid only for image subresources of images created with the VK_IMAGE_USAGE_VIDEO_ENCODE_QUANTIZATION_DELTA_MAP_BIT_KHR or VK_IMAGE_USAGE_VIDEO_ENCODE_EMPHASIS_MAP_BIT_KHR usage flags set.
IMAGE_LAYOUT_TENSOR_ALIASING_ARMspecifies the layout that an image created withIMAGE_TILING_OPTIMALmust be in, if the unifiedImageLayouts feature is disabled, or may be in if it is enabled, for it and a tensor bound to the same aliased range of memory to consistently interpret the data in memory. See https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#resources-memory-aliasing for a complete set of rules for tensor/image aliasing. This layout is valid only for image subresources of images created with theIMAGE_USAGE_TENSOR_ALIASING_BIT_ARMusage flag set.
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://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#clears
and
https://registry.khronos.org/vulkan/specs/latest/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://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#descriptorsets-updates).
If the
unifiedImageLayouts
feature is enabled, the IMAGE_LAYOUT_GENERAL image layout may be
used in place of the other layouts where allowed with no loss of
performance.
IMAGE_LAYOUT_GENERAL can be a useful catch-all image layout, but there
are situations where a dedicated image layout must be used instead. Some
examples include:
IMAGE_LAYOUT_PRESENT_SRC_KHRIMAGE_LAYOUT_SHARED_PRESENT_KHR- VK_IMAGE_LAYOUT_VIDEO_DECODE_SRC_KHR, VK_IMAGE_LAYOUT_VIDEO_DECODE_DST_KHR, and VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR without the unifiedImageLayoutsVideo feature
- VK_IMAGE_LAYOUT_VIDEO_ENCODE_SRC_KHR, VK_IMAGE_LAYOUT_VIDEO_ENCODE_DST_KHR, and VK_IMAGE_LAYOUT_VIDEO_ENCODE_DPB_KHR without the unifiedImageLayoutsVideo feature
- VK_IMAGE_LAYOUT_VIDEO_ENCODE_QUANTIZATION_MAP_KHR without the unifiedImageLayoutsVideo feature
While IMAGE_LAYOUT_GENERAL suggests that all types of device access is
possible, it does not mean that all patterns of memory accesses are safe
in all situations.
Common Render Pass Data Races
outlines some situations where data races are unavoidable. For example,
when a subresource is used as both an attachment and a sampled image
(i.e., not an input attachment),
enabling feedback loop
adds extra guarantees which IMAGE_LAYOUT_GENERAL alone does not.
See Also
VK_VERSION_1_0,
AttachmentDescription,
AttachmentDescription2,
AttachmentDescriptionStencilLayout,
AttachmentReference,
AttachmentReference2,
AttachmentReferenceStencilLayout,
BlitImageInfo2,
CopyBufferToImageInfo2,
CopyImageInfo2,
CopyImageToBufferInfo2,
PromotedStreamingTransfers.CopyImageToImageInfo',
PromotedStreamingTransfers.CopyImageToMemoryInfo',
CopyMemoryToImageIndirectInfoKHR,
PromotedStreamingTransfers.CopyMemoryToImageInfo',
DescriptorImageInfo,
PromotedStreamingTransfers.HostImageLayoutTransitionInfo',
ImageCreateInfo,
ImageDescriptorInfoEXT,
ImageMemoryBarrier,
ImageMemoryBarrier2,
PromotedStreamingTransfers.PhysicalDeviceHostImageCopyProperties',
PhysicalDeviceVulkan14Properties,
RenderingAttachmentInfo,
RenderingFragmentDensityMapAttachmentInfoEXT,
RenderingFragmentShadingRateAttachmentInfoKHR,
ResolveImageInfo2,
bindOpticalFlowSessionImageNV,
cmdBindInvocationMaskHUAWEI,
cmdBindShadingRateImageNV,
cmdBlitImage,
cmdClearColorImage,
cmdClearDepthStencilImage,
cmdCopyBufferToImage,
cmdCopyImage,
cmdCopyImageToBuffer,
cmdCopyMemoryToImageIndirectNV,
cmdResolveImage
Constructors
| ImageLayout Int32 |
Bundled Patterns