HORIZON HASKELLDocslts/ghc-9.14.x3e2d5682026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 3e2d568 · 2026-10-11

Modulevulkan-3.27GHC2021

Vulkan.Extensions.VK_KHR_get_surface_capabilities2

Name

VK_KHR_get_surface_capabilities2 - instance extension

VK_KHR_get_surface_capabilities2

Name String

VK_KHR_get_surface_capabilities2

Extension Type

Instance extension

Registered Extension Number

120

Revision

1

Ratification Status

Ratified

Extension and Version Dependencies

VK_KHR_surface

Contact

Other Extension Metadata

Last Modified Date

2017-02-27

IP Status

No known IP claims.

Contributors
  • Ian Elliott, Google

  • James Jones, NVIDIA

  • Alon Or-bach, Samsung

Description

This extension provides new queries for device surface capabilities that can be easily extended by other extensions, without introducing any further queries. This extension can be considered the VK_KHR_surface equivalent of the VK_KHR_get_physical_device_properties2 extension.

New Commands

New Structures

New Enum Constants

Issues

1) What should this extension be named?

RESOLVED: VK_KHR_get_surface_capabilities2. Other alternatives:

  • VK_KHR_surface2
  • One extension, combining a separate display-specific query extension.

2) Should additional WSI query functions be extended?

RESOLVED:

Version History

  • Revision 1, 2017-02-27 (James Jones)

    • Initial draft.

See Also

No cross-references are available

Document Notes

For more information, see the Vulkan Specification.

This page is a generated document. Fixes and changes should be made to the generator scripts, not directly.

  • 13 types
  • 2 values
  • Packagevulkan-3.27
  • Exports46
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceVK_KHR_get_surface_capabilities2.hs
valuegetPhysicalDeviceSurfaceCapabilities2KHR
  1. :: (Extendss PhysicalDeviceSurfaceInfo2KHR a, PokeChain a, Extendss SurfaceCapabilities2KHR b, PokeChain b, PeekChain b, MonadIO io)
  2. => PhysicalDevice

    physicalDevice is the physical device that will be associated with the swapchain to be created, as described for createSwapchainKHR.

  3. -> PhysicalDeviceSurfaceInfo2KHR a

    pSurfaceInfo is a pointer to a PhysicalDeviceSurfaceInfo2KHR structure describing the surface and other fixed parameters that would be consumed by createSwapchainKHR.

  4. -> io (SurfaceCapabilities2KHR b)
#

vkGetPhysicalDeviceSurfaceCapabilities2KHR - Reports capabilities of a surface on a physical device

Description

getPhysicalDeviceSurfaceCapabilities2KHR behaves similarly to getPhysicalDeviceSurfaceCapabilitiesKHR, with the ability to specify extended inputs via chained input structures, and to return extended information via chained output structures.

Valid Usage

  • If the VK_GOOGLE_surfaceless_query extension is not enabled, pSurfaceInfo->surface must be a valid SurfaceKHR handle

Valid Usage (Implicit)

Return Codes

Success
Failure

See Also

VK_KHR_get_surface_capabilities2, PhysicalDevice, PhysicalDeviceSurfaceInfo2KHR, SurfaceCapabilities2KHR

valuegetPhysicalDeviceSurfaceFormats2KHR
  1. :: (Extendss PhysicalDeviceSurfaceInfo2KHR a, PokeChain a, Extendss SurfaceFormat2KHR b, PokeChain b, PeekChain b, MonadIO io)
  2. => PhysicalDevice

    physicalDevice is the physical device that will be associated with the swapchain to be created, as described for createSwapchainKHR.

  3. -> PhysicalDeviceSurfaceInfo2KHR a

    pSurfaceInfo is a pointer to a PhysicalDeviceSurfaceInfo2KHR structure describing the surface and other fixed parameters that would be consumed by createSwapchainKHR.

  4. -> io (Result, "surfaceFormats" ::: Vector (SurfaceFormat2KHR b))
#

vkGetPhysicalDeviceSurfaceFormats2KHR - Query color formats supported by surface

Description

getPhysicalDeviceSurfaceFormats2KHR behaves similarly to getPhysicalDeviceSurfaceFormatsKHR, with the ability to be extended via pNext chains.

If pSurfaceFormats is NULL, then the number of format tuples supported for the given surface is returned in pSurfaceFormatCount. Otherwise, pSurfaceFormatCount must point to a variable set by the application to the number of elements in the pSurfaceFormats array, and on return the variable is overwritten with the number of structures actually written to pSurfaceFormats. If the value of pSurfaceFormatCount is less than the number of format tuples supported, at most pSurfaceFormatCount structures will be written, and INCOMPLETE will be returned instead of SUCCESS, to indicate that not all the available values were returned.

Valid Usage

  • If the VK_GOOGLE_surfaceless_query extension is not enabled, pSurfaceInfo->surface must be a valid SurfaceKHR handle

Valid Usage (Implicit)

  • pSurfaceInfo must be a valid pointer to a valid PhysicalDeviceSurfaceInfo2KHR structure

  • pSurfaceFormatCount must be a valid pointer to a uint32_t value

  • If the value referenced by pSurfaceFormatCount is not 0, and pSurfaceFormats is not NULL, pSurfaceFormats must be a valid pointer to an array of pSurfaceFormatCount SurfaceFormat2KHR structures

Return Codes

Success
Failure

See Also

VK_KHR_get_surface_capabilities2, PhysicalDevice, PhysicalDeviceSurfaceInfo2KHR, SurfaceFormat2KHR

datadata PhysicalDeviceSurfaceInfo2KHR (es :: [Type])
#

VkPhysicalDeviceSurfaceInfo2KHR - Structure specifying a surface and related swapchain creation parameters

Description

The members of PhysicalDeviceSurfaceInfo2KHR correspond to the arguments to getPhysicalDeviceSurfaceCapabilitiesKHR, with sType and pNext added for extensibility.

Additional capabilities of a surface may be available to swapchains created with different full-screen exclusive settings - particularly if exclusive full-screen access is application controlled. These additional capabilities can be queried by adding a SurfaceFullScreenExclusiveInfoEXT structure to the pNext chain of this structure when used to query surface properties. Additionally, for Win32 surfaces with application controlled exclusive full-screen access, chaining a SurfaceFullScreenExclusiveWin32InfoEXT structure may also report additional surface capabilities. These additional capabilities only apply to swapchains created with the same parameters included in the pNext chain of SwapchainCreateInfoKHR.

Valid Usage

  • If surface is not VK_NULL_HANDLE, and the VK_GOOGLE_surfaceless_query extension is not enabled, surface must be a valid SurfaceKHR handle

Valid Usage (Implicit)

See Also

VK_KHR_get_surface_capabilities2, StructureType, SurfaceKHR, getDeviceGroupSurfacePresentModes2EXT, getPhysicalDeviceSurfaceCapabilities2KHR, getPhysicalDeviceSurfaceFormats2KHR, getPhysicalDeviceSurfacePresentModes2EXT

Constructors

Instances5Extensible, Show, FromCStruct, ToCStruct, Zero
datadata SurfaceCapabilities2KHR (es :: [Type])
#

VkSurfaceCapabilities2KHR - Structure describing capabilities of a surface

Description

If the VK_GOOGLE_surfaceless_query extension is enabled and PhysicalDeviceSurfaceInfo2KHR::surface in the getPhysicalDeviceSurfaceCapabilities2KHR call is NULL_HANDLE, the values returned in minImageCount, maxImageCount, currentExtent, and currentTransform will not reflect that of any surface and will instead be as such:

Valid Usage (Implicit)

See Also

VK_KHR_get_surface_capabilities2, StructureType, SurfaceCapabilitiesKHR, getPhysicalDeviceSurfaceCapabilities2KHR

Constructors

Instances5Extensible, Show, FromCStruct, ToCStruct, Zero
datadata SurfaceFormat2KHR (es :: [Type])
#

VkSurfaceFormat2KHR - Structure describing a supported swapchain format tuple

Description

If the imageCompressionControlSwapchain feature is supported and a ImageCompressionPropertiesEXT structure is included in the pNext chain of this structure, then it will be filled with the compression properties that are supported for the surfaceFormat.

Valid Usage

  • If the VK_EXT_image_compression_control_swapchain extension is not supported, the pNext chain must not include an ImageCompressionPropertiesEXT structure

Valid Usage (Implicit)

  • pNext must be NULL or a pointer to a valid instance of ImageCompressionPropertiesEXT

  • The sType value of each structure in the pNext chain must be unique

See Also

VK_KHR_get_surface_capabilities2, StructureType, SurfaceFormatKHR, getPhysicalDeviceSurfaceFormats2KHR

Constructors

Instances5Extensible, Show, FromCStruct, ToCStruct, Zero
newtypenewtype SurfaceKHR
#
Instances7Eq, Ord, Show, Storable, HasObjectType, IsHandle, …

VkSurfaceCapabilitiesKHR - Structure describing capabilities of a surface

Description

Supported usage flags of a presentable image when using PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR or PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR presentation mode are provided by SharedPresentSurfaceCapabilitiesKHR::sharedPresentSupportedUsageFlags.

Formulas such as min(N, maxImageCount) are not correct, since maxImageCount may be zero.

See Also

VK_KHR_surface, CompositeAlphaFlagsKHR, Extent2D, ImageUsageFlags, SurfaceCapabilities2KHR, SurfaceTransformFlagBitsKHR, SurfaceTransformFlagsKHR, getPhysicalDeviceSurfaceCapabilitiesKHR

Constructors

  • SurfaceCapabilitiesKHR
    • minImageCount :: Word32

      minImageCount is the minimum number of images the specified device supports for a swapchain created for the surface, and will be at least one.

    • maxImageCount :: Word32

      maxImageCount is the maximum number of images the specified device supports for a swapchain created for the surface, and will be either 0, or greater than or equal to minImageCount. A value of 0 means that there is no limit on the number of images, though there may be limits related to the total amount of memory used by presentable images.

    • currentExtent :: Extent2D

      currentExtent is the current width and height of the surface, or the special value (0xFFFFFFFF, 0xFFFFFFFF) indicating that the surface size will be determined by the extent of a swapchain targeting the surface.

    • minImageExtent :: Extent2D

      minImageExtent contains the smallest valid swapchain extent for the surface on the specified device. The width and height of the extent will each be less than or equal to the corresponding width and height of currentExtent, unless currentExtent has the special value described above.

    • maxImageExtent :: Extent2D

      maxImageExtent contains the largest valid swapchain extent for the surface on the specified device. The width and height of the extent will each be greater than or equal to the corresponding width and height of minImageExtent. The width and height of the extent will each be greater than or equal to the corresponding width and height of currentExtent, unless currentExtent has the special value described above.

    • maxImageArrayLayers :: Word32

      maxImageArrayLayers is the maximum number of layers presentable images can have for a swapchain created for this device and surface, and will be at least one.

    • supportedTransforms :: SurfaceTransformFlagsKHR

      supportedTransforms is a bitmask of SurfaceTransformFlagBitsKHR indicating the presentation transforms supported for the surface on the specified device. At least one bit will be set.

    • currentTransform :: SurfaceTransformFlagBitsKHR

      currentTransform is SurfaceTransformFlagBitsKHR value indicating the surface’s current transform relative to the presentation engine’s natural orientation.

    • supportedCompositeAlpha :: CompositeAlphaFlagsKHR

      supportedCompositeAlpha is a bitmask of CompositeAlphaFlagBitsKHR, representing the alpha compositing modes supported by the presentation engine for the surface on the specified device, and at least one bit will be set. Opaque composition can be achieved in any alpha compositing mode by either using an image format that has no alpha component, or by ensuring that all pixels in the presentable images have an alpha value of 1.0.

    • supportedUsageFlags :: ImageUsageFlags

      supportedUsageFlags is a bitmask of ImageUsageFlagBits representing the ways the application can use the presentable images of a swapchain created with PresentModeKHR set to PRESENT_MODE_FIFO_LATEST_READY_KHR, PRESENT_MODE_IMMEDIATE_KHR, PRESENT_MODE_MAILBOX_KHR, PRESENT_MODE_FIFO_KHR or PRESENT_MODE_FIFO_RELAXED_KHR for the surface on the specified device. IMAGE_USAGE_COLOR_ATTACHMENT_BIT must be included in the set. Implementations may support additional usages.

Instances5Show, Storable, FromCStruct, ToCStruct, Zero
datadata SurfaceFormatKHR
#

VkSurfaceFormatKHR - Structure describing a supported swapchain format-color space pair

See Also

VK_KHR_surface, ColorSpaceKHR, Format, SurfaceFormat2KHR, getPhysicalDeviceSurfaceFormatsKHR

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero
newtypenewtype ColorSpaceKHR
#

VkColorSpaceKHR - Supported color space of the presentation engine

Description

In the initial release of the VK_KHR_surface and VK_KHR_swapchain extensions, the token COLORSPACE_SRGB_NONLINEAR_KHR was used. Starting in the 2016-05-13 updates to the extension branches, matching release 1.0.13 of the core API specification, COLOR_SPACE_SRGB_NONLINEAR_KHR is used instead for consistency with Vulkan naming rules. The older enum is still available for backwards compatibility.

In older versions of this extension COLOR_SPACE_DISPLAY_P3_LINEAR_EXT was misnamed COLOR_SPACE_DCI_P3_LINEAR_EXT. This has been updated to indicate that it uses RGB color encoding, not XYZ. The old name is legacy but is maintained for backwards compatibility.

In older versions of the VK_EXT_swapchain_colorspace extension, COLOR_SPACE_DOLBYVISION_EXT was exposed. The intent was to indicate the presentation engine shall decode an image using the SMPTE ST 2084 Perceptual Quantizer (PQ) EOTF, and then apply a proprietary OOTF to process the image. However, Dolby Vision profile 8.4 describes an encoding using the Hybrid Log Gamma (HLG) OETF, and there is no swapchain extension for signaling Dolby Vision metadata to be used by a proprietary OOTF. This enum is legacy but is maintained for backwards compatibility.

For a traditional “Linear” or non-gamma transfer function color space use COLOR_SPACE_PASS_THROUGH_EXT.

On Wayland, COLOR_SPACE_PASS_THROUGH_EXT can be used to disable color management by the WSI on a surface, which makes it possible for the application to create a wp_color_management_surface_v1 object without triggering a surface_exists protocol error.

See createWaylandSurfaceKHR

The presentation engine interprets the pixel values of the R, G, and B components as having been encoded using an appropriate transfer function. Applications should ensure that the appropriate transfer function has been applied. Texel encode requires that all implementations implicitly apply the sRGB EOTF-1 on R, G, and B components when shaders write to an sRGB pixel format image, which is useful for sRGB color spaces. For sRGB color spaces with other pixel formats, or other non-linear color spaces, applications can apply the transfer function explicitly in a shader. The A channel is always interpreted as linearly encoded.

This extension defines enums for ColorSpaceKHR that correspond to the following color spaces:

Name

Red Primary

Green Primary

Blue Primary

White-point

Transfer function

DCI-P3

1.000, 0.000

0.000, 1.000

0.000, 0.000

0.3333, 0.3333

DCI P3

Display-P3

0.680, 0.320

0.265, 0.690

0.150, 0.060

0.3127, 0.3290 (D65)

Display-P3

BT709

0.640, 0.330

0.300, 0.600

0.150, 0.060

0.3127, 0.3290 (D65)

BT709

sRGB

0.640, 0.330

0.300, 0.600

0.150, 0.060

0.3127, 0.3290 (D65)

sRGB

extended sRGB

0.640, 0.330

0.300, 0.600

0.150, 0.060

0.3127, 0.3290 (D65)

scRGB

HDR10_ST2084

0.708, 0.292

0.170, 0.797

0.131, 0.046

0.3127, 0.3290 (D65)

ST2084 PQ

HDR10_HLG

0.708, 0.292

0.170, 0.797

0.131, 0.046

0.3127, 0.3290 (D65)

HLG

Adobe RGB

0.640, 0.330

0.210, 0.710

0.150, 0.060

0.3127, 0.3290 (D65)

Adobe RGB

Color Spaces and Attributes

The transfer functions are described in the “Transfer Functions” chapter of the Khronos Data Format Specification.

Except Display-P3 OETF, which is:

[begin{aligned} E & = begin{cases} 1.055 times L^{1 over 2.4} - 0.055 & text{for} 0.0030186 leq L leq 1 -- 12.92 times L & text{for} 0 leq L < 0.0030186

Constructors

Instances6Eq, Ord, Read, Show, Storable, Zero
newtypenewtype CompositeAlphaFlagBitsKHR
#

VkCompositeAlphaFlagBitsKHR - Alpha compositing modes supported on a device

Description

These values are described as follows:

  • COMPOSITE_ALPHA_OPAQUE_BIT_KHR: The alpha component, if it exists, of the images is ignored in the compositing process. Instead, the image is treated as if it has a constant alpha of 1.0.

  • COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR: The alpha component, if it exists, of the images is respected in the compositing process. The non-alpha components of the image are expected to already be multiplied by the alpha component by the application.

  • COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR: The alpha component, if it exists, of the images is respected in the compositing process. The non-alpha components of the image are not expected to already be multiplied by the alpha component by the application; instead, the compositor will multiply the non-alpha components of the image by the alpha component during compositing.

  • COMPOSITE_ALPHA_INHERIT_BIT_KHR: The way in which the presentation engine treats the alpha component in the images is unknown to the Vulkan API. Instead, the application is responsible for setting the composite alpha blending mode using native window system commands. If the application does not set the blending mode using native window system commands, then a platform-specific default will be used.

See Also

VK_KHR_surface, CompositeAlphaFlagsKHR, SwapchainCreateInfoKHR

Instances8Eq, Ord, Read, Show, Bits, FiniteBits, …
newtypenewtype SurfaceTransformFlagBitsKHR
#

VkSurfaceTransformFlagBitsKHR - Presentation transforms supported on a device

Description

See Also

VK_KHR_surface, CommandBufferInheritanceRenderPassTransformInfoQCOM, CopyCommandTransformInfoQCOM, DisplaySurfaceCreateInfoKHR, RenderPassTransformBeginInfoQCOM, SurfaceCapabilities2EXT, SurfaceCapabilitiesKHR, SurfaceTransformFlagsKHR, SwapchainCreateInfoKHR

Instances8Eq, Ord, Read, Show, Bits, FiniteBits, …