Vulkan

Android 7.0 adds support for Vulkan, a low-overhead, cross-platform API for high-performance 3D graphics. Like OpenGL ES, Vulkan provides tools for creating high-quality, real-time graphics in applications. Vulkan advantages include reductions in CPU overhead and support for the SPIR-V Binary Intermediate language.

System on chip vendors (SoCs) such as GPU Independent Hardware Vendors (IHVs) can write Vulkan drivers for Android; OEMs simply need to integrate these drivers for specific devices. For details on how a Vulkan driver interacts with the system, how GPU-specific tools should be installed, and Android-specific requirements, see Implementing Vulkan.

Application developers can take advantage of Vulkan to create apps that execute commands on the GPU with significantly reduced overhead. Vulkan also provides a more direct mapping to the capabilities found in current graphics hardware, minimizing opportunities for driver bugs and reducing developer testing time (e.g. less time required to troubleshoot Vulkan bugs).

For general information on Vulkan, refer to the Vulkan Overview or see the list of Resources below.

Vulkan components

Vulkan support includes the following components:

Figure 1: Vulkan components

  • Vulkan Validation Layers (provided in the Android NDK). A set of libraries used by developers during the development of Vulkan apps. The Vulkan runtime library and the Vulkan driver from graphics vendors do not contain runtime error-checking to keep Vulkan runtime efficient. Instead, the validation libraries are used (only during development) to find errors in an application's use of the Vulkan API. The Vulkan Validation libraries are linked into the app during development and perform this error checking. After all API usage issues are found, the aplication no longer needs to include these libraries in the app.
  • Vulkan Runtime (provided by Android). A native library (libvulkan.so) that provides a new public native API called Vulkan. Most functionality is implemented by a driver provided by the GPU vendor; the runtime wraps the driver, provides API interception capabilities (for debugging and other developer tools), and manages the interaction between the driver and platform dependencies such as BufferQueue.
  • Vulkan Driver (provided by SoC). Maps the Vulkan API onto hardware-specific GPU commands and interactions with the kernel graphics driver.

Modified components

Android 7.0 modifies the following existing graphics components to support Vulkan:

  • BufferQueue. The Vulkan Runtime interacts with the existing BufferQueue component via the existing ANativeWindow interface. Includes minor modifications (new enum values and new methods) to ANativeWindow and BufferQueue, but no architectural changes.
  • Gralloc HAL. Includes a new, optional interface for discovering whether a given format can be used for a particular producer/consumer combination without actually allocating a buffer.

For details on these components, see BufferQueue and gralloc (for details on ANativeWindow, see EGLSurface and OpenGL ES).

Vulkan API

The Android platform includes an Android-specific implementation of the Vulkan API specification from the Khronos Group. Android applications must use the Window System Integration (WSI) extensions to output their rendering.

Resources

Use the following resources to learn more about Vulkan:

  • Vulkan Loader (libvulkan.so) at platform/frameworks/native/vulkan. Contains Android's Vulkan loader, as well as some Vulkan-related tools useful to platform developers.
  • Vulkan Implementor's Guide. Intended for GPU IHVs writing Vulkan drivers for Android and OEMs integrating those drivers for specific devices. It describes how a Vulkan driver interacts with the system, how GPU-specific tools should be installed, and Android-specific requirements.
  • Vulkan Graphics API Guide. Includes information on getting started with using Vulkan in an Android app, details on Vulkan design guidelines on the Android platform, how to use Vulkan's shader compilers, and how to use use validation layers to help assure stability in apps using Vulkan.
  • Vulkan News. Covers events, patches, tutorials, and more Vulkan-related news articles.