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

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Modulevulkan-3.27GHC2021

Vulkan.Extensions.VK_KHR_android_surface

Name

VK_KHR_android_surface - instance extension

VK_KHR_android_surface

Name String

VK_KHR_android_surface

Extension Type

Instance extension

Registered Extension Number

9

Revision

6

Ratification Status

Ratified

Extension and Version Dependencies

VK_KHR_surface

Contact

Other Extension Metadata

Last Modified Date

2016-01-14

IP Status

No known IP claims.

Contributors
  • Patrick Doane, Blizzard

  • Faith Ekstrand, Intel

  • Ian Elliott, LunarG

  • Courtney Goeltzenleuchter, LunarG

  • Jesse Hall, Google

  • James Jones, NVIDIA

  • Antoine Labour, Google

  • Jon Leech, Khronos

  • David Mao, AMD

  • Norbert Nopper, Freescale

  • Alon Or-bach, Samsung

  • Daniel Rakos, AMD

  • Graham Sellers, AMD

  • Ray Smith, ARM

  • Jeff Vigil, Qualcomm

  • Chia-I Wu, LunarG

Description

The VK_KHR_android_surface extension is an instance extension. It provides a mechanism to create a SurfaceKHR object (defined by the VK_KHR_surface extension) that refers to an ANativeWindow, Android’s native surface type. The ANativeWindow represents the producer endpoint of any buffer queue, regardless of consumer endpoint. Common consumer endpoints for ANativeWindows are the system window compositor, video encoders, and application-specific compositors importing the images through a SurfaceTexture.

New Base Types

New Commands

New Structures

New Bitmasks

New Enum Constants

Issues

1) Does Android need a way to query for compatibility between a particular physical device (and queue family?) and a specific Android display?

RESOLVED: No. Currently on Android, any physical device is expected to be able to present to the system compositor, and all queue families must support the necessary image layout transitions and synchronization operations.

Version History

  • Revision 1, 2015-09-23 (Jesse Hall)

    • Initial draft.

  • Revision 2, 2015-10-26 (Ian Elliott)

    • Renamed from VK_EXT_KHR_android_surface to VK_KHR_android_surface.

  • Revision 3, 2015-11-03 (Daniel Rakos)

    • Added allocation callbacks to surface creation function.

  • Revision 4, 2015-11-10 (Jesse Hall)

    • Removed VK_ERROR_INVALID_ANDROID_WINDOW_KHR.

  • Revision 5, 2015-11-28 (Daniel Rakos)

    • Updated the surface create function to take a pCreateInfo structure.

  • Revision 6, 2016-01-14 (James Jones)

    • Moved VK_ERROR_NATIVE_WINDOW_IN_USE_KHR from the VK_KHR_android_surface to the VK_KHR_surface extension.

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.

  • 6 types
  • 1 value
  • Packagevulkan-3.27
  • Exports9
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceVK_KHR_android_surface.hs
valuecreateAndroidSurfaceKHR
  1. :: MonadIO io
  2. => Instance

    instance is the instance to associate the surface with.

  3. -> AndroidSurfaceCreateInfoKHR

    pCreateInfo is a pointer to a AndroidSurfaceCreateInfoKHR structure containing parameters affecting the creation of the surface object.

  4. -> "allocator" ::: Maybe AllocationCallbacks

    pAllocator is the allocator used for host memory allocated for the surface object when there is no more specific allocator available (see Memory Allocation).

  5. -> io SurfaceKHR
#

vkCreateAndroidSurfaceKHR - Create a SurfaceKHR object for an Android native window

Description

During the lifetime of a surface created using a particular ANativeWindow handle any attempts to create another surface for the same ANativeWindow and any attempts to connect to the same ANativeWindow through other platform mechanisms will fail.

In particular, only one SurfaceKHR can exist at a time for a given window. Similarly, a native window cannot be used by both a SurfaceKHR and EGLSurface simultaneously.

If successful, createAndroidSurfaceKHR increments the ANativeWindow’s reference count, and destroySurfaceKHR will decrement it.

On Android, when a swapchain’s imageExtent does not match the surface’s currentExtent, the presentable images will be scaled to the surface’s dimensions during presentation. minImageExtent is (1,1), and maxImageExtent is the maximum image size supported by the consumer. For the system compositor, currentExtent is the window size (i.e. the consumer’s preferred size).

Valid Usage (Implicit)

  • instance must be a valid Instance handle

Return Codes

Success
Failure

See Also

VK_KHR_android_surface, AllocationCallbacks, AndroidSurfaceCreateInfoKHR, Instance, SurfaceKHR

VkAndroidSurfaceCreateInfoKHR - Structure specifying parameters of a newly created Android surface object

Valid Usage (Implicit)

See Also

VK_KHR_android_surface, AndroidSurfaceCreateFlagsKHR, StructureType, createAndroidSurfaceKHR

Constructors

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

VkAndroidSurfaceCreateFlagsKHR - Reserved for future use

Description

AndroidSurfaceCreateFlagsKHR is a bitmask type for setting a mask, but is currently reserved for future use.

See Also

VK_KHR_android_surface, AndroidSurfaceCreateInfoKHR, Flags

Instances8Eq, Ord, Read, Show, Bits, FiniteBits, …
newtypenewtype SurfaceKHR
#
Instances7Eq, Ord, Show, Storable, HasObjectType, IsHandle, …