VKCREATEANDROIDSURFA(3)

NAME
vkCreateAndroidSurfaceKHR - Create a slink:VkSurfaceKHR object for an Android native window

C SPECIFICATION

To create a VkSurfaceKHR object for an Android native window, call:

PARAMETERS

    • instance is the instance to associate the surface with.

    • pCreateInfo is a pointer to an instance of the VkAndroidSurfaceCreateInfoKHR structure containing parameters affecting the creation of the surface object.

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

    • pSurface points to a VkSurfaceKHR handle in which the created surface object is returned.

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.

    NOTE

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

If successful, vkCreateAndroidSurfaceKHR increments the ANativeWindow’s reference count, and vkDestroySurfaceKHR will decrement it.

On Android, when a swapchain’s imageExtent does not match the surface’s currentExtent, the swapchain 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).

SEE ALSO

VkAllocationCallbacks, VkAndroidSurfaceCreateInfoKHR, VkInstance, VkSurfaceKHR

DOCUMENT NOTES

For more information, see the Vulkan Specification at URL

https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkCreateAndroidSurfaceKHR

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification,not directly.

COPYRIGHT

Copyright (c) 2014-2016 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.

AUTHOR

Khronos Group
    Author.