Top Description Fields Constructors Methods
org.lwjgl.vulkan

public Class KHRAndroidSurface

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.system.*

The 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.
VK_KHR_android_surface
Name String
VK_KHR_android_surface
Extension Type
Instance extension
Registered Extension Number
9
Revision
6
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

Field Summary

Modifier and TypeField and Description
public static final String
public static final int
VK_KHR_ANDROID_SURFACE_SPEC_VERSION

The extension specification version.

public static final int

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static int
nvkCreateAndroidSurfaceKHR(VkInstance instance, long pCreateInfo, long pAllocator, long pSurface)

Unsafe version of: CreateAndroidSurfaceKHR

public static int
vkCreateAndroidSurfaceKHR(VkInstance
the instance to associate the surface with.
instance
,
VkAndroidSurfaceCreateInfoKHR
a pointer to a VkAndroidSurfaceCreateInfoKHR structure containing parameters affecting the creation of the surface object.
pCreateInfo
,
VkAllocationCallbacks
the allocator used for host memory allocated for the surface object when there is no more specific allocator available (see Memory Allocation).
pAllocator
,
LongBuffer
a pointer to a VkSurfaceKHR handle in which the created surface object is returned.
pSurface
)

Create a VkSurfaceKHR object for an Android native window.

public static int
vkCreateAndroidSurfaceKHR(VkInstance instance, VkAndroidSurfaceCreateInfoKHR pCreateInfo, VkAllocationCallbacks pAllocator, long[] pSurface)

Array version of: CreateAndroidSurfaceKHR

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

VK_KHR_ANDROID_SURFACE_EXTENSION_NAMEback to summary
public static final String VK_KHR_ANDROID_SURFACE_EXTENSION_NAME

The extension name.

VK_KHR_ANDROID_SURFACE_SPEC_VERSIONback to summary
public static final int VK_KHR_ANDROID_SURFACE_SPEC_VERSION

The extension specification version.

VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHRback to summary
public static final int VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR

Extends VkStructureType.

Constructor Detail

KHRAndroidSurfaceback to summary
protected KHRAndroidSurface()

Method Detail

nvkCreateAndroidSurfaceKHRback to summary
public static int nvkCreateAndroidSurfaceKHR(VkInstance instance, long pCreateInfo, long pAllocator, long pSurface)

Unsafe version of: CreateAndroidSurfaceKHR

vkCreateAndroidSurfaceKHRback to summary
public static int vkCreateAndroidSurfaceKHR(VkInstance instance, VkAndroidSurfaceCreateInfoKHR pCreateInfo, VkAllocationCallbacks pAllocator, LongBuffer pSurface)

Create a VkSurfaceKHR object for an Android native window.

C Specification

To create a VkSurfaceKHR object 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 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 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 VkInstance handle
  • pCreateInfo must be a valid pointer to a valid VkAndroidSurfaceCreateInfoKHR structure
  • If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure
  • pSurface must be a valid pointer to a VkSurfaceKHR handle
Return Codes
On success, this command returns
On failure, this command returns
See Also

VkAllocationCallbacks, VkAndroidSurfaceCreateInfoKHR

Parameters
instance:VkInstance

the instance to associate the surface with.

pCreateInfo:VkAndroidSurfaceCreateInfoKHR

a pointer to a VkAndroidSurfaceCreateInfoKHR structure containing parameters affecting the creation of the surface object.

pAllocator:VkAllocationCallbacks

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

pSurface:LongBuffer

a pointer to a VkSurfaceKHR handle in which the created surface object is returned.

Annotations
@NativeType:VkResult
vkCreateAndroidSurfaceKHRback to summary
public static int vkCreateAndroidSurfaceKHR(VkInstance instance, VkAndroidSurfaceCreateInfoKHR pCreateInfo, VkAllocationCallbacks pAllocator, long[] pSurface)

Array version of: CreateAndroidSurfaceKHR

Annotations
@NativeType:VkResult