Class KHRAndroidSurface

java.lang.Object
org.lwjgl.vulkan.KHRAndroidSurface

public class KHRAndroidSurface extends Object
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.
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 Details

    • VK_KHR_ANDROID_SURFACE_SPEC_VERSION

      public static final int VK_KHR_ANDROID_SURFACE_SPEC_VERSION
      The extension specification version.
      See Also:
    • VK_KHR_ANDROID_SURFACE_EXTENSION_NAME

      public static final String 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_KHR
      Extends VkStructureType.
      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 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 - the instance to associate the surface with.
      pCreateInfo - a pointer to a VkAndroidSurfaceCreateInfoKHR structure 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 a VkSurfaceKHR handle 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