Class KHRAndroidSurface
VK_KHR_android_surface extension is an instance extension. It provides a mechanism to create a VkSurfaceKHR 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.
- Name String
VK_KHR_android_surface- Extension Type
- Instance extension
- Registered Extension Number
- 9
- Revision
- 6
- Extension and Version Dependencies
VK_KHR_surface- Contact
- Jesse Hall critsec
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
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe extension name.static final intThe extension specification version.static final intExtendsVkStructureType. -
Method Summary
Modifier and TypeMethodDescriptionstatic intnvkCreateAndroidSurfaceKHR(org.lwjgl.vulkan.VkInstance instance, long pCreateInfo, long pAllocator, long pSurface) Unsafe version of:CreateAndroidSurfaceKHRstatic intvkCreateAndroidSurfaceKHR(org.lwjgl.vulkan.VkInstance instance, VkAndroidSurfaceCreateInfoKHR pCreateInfo, @Nullable VkAllocationCallbacks pAllocator, long[] pSurface) Array version of:CreateAndroidSurfaceKHRstatic intvkCreateAndroidSurfaceKHR(org.lwjgl.vulkan.VkInstance instance, VkAndroidSurfaceCreateInfoKHR pCreateInfo, @Nullable VkAllocationCallbacks pAllocator, LongBuffer pSurface) Create aVkSurfaceKHRobject for an Android native window.
-
Field Details
-
VK_KHR_ANDROID_SURFACE_SPEC_VERSION
public static final int VK_KHR_ANDROID_SURFACE_SPEC_VERSIONThe extension specification version.- See Also:
-
VK_KHR_ANDROID_SURFACE_EXTENSION_NAME
The extension name.- See Also:
-
VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR
public static final int VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHRExtendsVkStructureType.- See Also:
-
-
Method Details
-
nvkCreateAndroidSurfaceKHR
public static int nvkCreateAndroidSurfaceKHR(org.lwjgl.vulkan.VkInstance instance, long pCreateInfo, long pAllocator, long pSurface) Unsafe version of:CreateAndroidSurfaceKHR -
vkCreateAndroidSurfaceKHR
public static int vkCreateAndroidSurfaceKHR(org.lwjgl.vulkan.VkInstance instance, VkAndroidSurfaceCreateInfoKHR pCreateInfo, @Nullable VkAllocationCallbacks pAllocator, LongBuffer pSurface) Create aVkSurfaceKHRobject for an Android native window.C Specification
To create a
VkSurfaceKHRobject for an Android native window, call:VkResult vkCreateAndroidSurfaceKHR( VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);Description
During the lifetime of a surface created using a particular
ANativeWindowhandle any attempts to create another surface for the sameANativeWindowand any attempts to connect to the sameANativeWindowthrough other platform mechanisms will fail.Note
In particular, only one
VkSurfaceKHRcan exist at a time for a given window. Similarly, a native window cannot be used by both aVkSurfaceKHRandEGLSurfacesimultaneously.If successful,
vkCreateAndroidSurfaceKHRincrements theANativeWindow’s reference count, andvkDestroySurfaceKHRwill decrement it.On Android, when a swapchain’s
imageExtentdoes not match the surface’scurrentExtent, the presentable images will be scaled to the surface’s dimensions during presentation.minImageExtentis(1,1), andmaxImageExtentis the maximum image size supported by the consumer. For the system compositor,currentExtentis the window size (i.e. the consumer’s preferred size).Valid Usage (Implicit)
instancemust be a validVkInstancehandlepCreateInfomust be a valid pointer to a validVkAndroidSurfaceCreateInfoKHRstructure- If
pAllocatoris notNULL,pAllocatormust be a valid pointer to a validVkAllocationCallbacksstructure pSurfacemust be a valid pointer to aVkSurfaceKHRhandle
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
instance- the instance to associate the surface with.pCreateInfo- a pointer to aVkAndroidSurfaceCreateInfoKHRstructure containing parameters affecting the creation of the surface object.pAllocator- the allocator used for host memory allocated for the surface object when there is no more specific allocator available (see Memory Allocation).pSurface- a pointer to aVkSurfaceKHRhandle in which the created surface object is returned.
-
vkCreateAndroidSurfaceKHR
public static int vkCreateAndroidSurfaceKHR(org.lwjgl.vulkan.VkInstance instance, VkAndroidSurfaceCreateInfoKHR pCreateInfo, @Nullable VkAllocationCallbacks pAllocator, long[] pSurface) Array version of:CreateAndroidSurfaceKHR
-