Home | History | Annotate | Download | only in graphics
      1 page.title=Vulkan
      2 @jd:body
      3 
      4 <!--
      5     Copyright 2016 The Android Open Source Project
      6 
      7     Licensed under the Apache License, Version 2.0 (the "License");
      8     you may not use this file except in compliance with the License.
      9     You may obtain a copy of the License at
     10 
     11         http://www.apache.org/licenses/LICENSE-2.0
     12 
     13     Unless required by applicable law or agreed to in writing, software
     14     distributed under the License is distributed on an "AS IS" BASIS,
     15     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     16     See the License for the specific language governing permissions and
     17     limitations under the License.
     18 -->
     19 <div id="qv-wrapper">
     20   <div id="qv">
     21     <h2>In this document</h2>
     22     <ol id="auto-toc">
     23     </ol>
     24   </div>
     25 </div>
     26 
     27 <p>Android 7.0 adds support for
     28 <a href="https://www.khronos.org/vulkan/">Vulkan</a>, a low-overhead,
     29 cross-platform API for high-performance 3D graphics. Like OpenGL ES, Vulkan
     30 provides tools for creating high-quality, real-time graphics in applications.
     31 Vulkan advantages include reductions in CPU overhead and support for the
     32 <a href="https://www.khronos.org/spir">SPIR-V Binary Intermediate</a> language.
     33 </p>
     34 
     35 <p>System on chip vendors (SoCs) such as GPU Independent Hardware Vendors (IHVs)
     36 can write Vulkan drivers for Android; OEMs simply need to integrate these
     37 drivers for specific devices. For details on how a Vulkan driver interacts with
     38 the system, how GPU-specific tools should be installed, and Android-specific
     39 requirements, see <a href="{@docRoot}devices/graphics/implement-vulkan.html">Implementing
     40 Vulkan.</a></p>
     41 
     42 <p>Application developers can take advantage of Vulkan to create apps that
     43 execute commands on the GPU with significantly reduced overhead. Vulkan also
     44 provides a more direct mapping to the capabilities found in current graphics
     45 hardware, minimizing opportunities for driver bugs and reducing developer
     46 testing time (e.g. less time required to troubleshoot Vulkan bugs).</p>
     47 
     48 <p>For general information on Vulkan, refer to the
     49 <a href="http://khr.io/vulkanlaunchoverview">Vulkan Overview</a> or see the list
     50 of <a href="#resources">Resources</a> below.</p>
     51 
     52 <h2 id=vulkan_components>Vulkan components</h2>
     53 <p>Vulkan support includes the following components:</p>
     54 <p><img src="{@docRoot}devices/graphics/images/ape_graphics_vulkan.png"></p>
     55 <p class=img-caption>Figure 1: Vulkan components</p>
     56 
     57 <ul>
     58 <li><strong>Vulkan Validation Layers</strong> (<em>provided in the Android
     59 NDK</em>). A set of libraries used by developers during the development of
     60 Vulkan apps. The Vulkan runtime library and the Vulkan driver from graphics
     61 vendors do not contain runtime error-checking to keep Vulkan runtime efficient.
     62 Instead, the validation libraries are used (only during development) to find
     63 errors in an application's use of the Vulkan API. The Vulkan Validation
     64 libraries are linked into the app during development and perform this error
     65 checking. After all API usage issues are found, the aplication no longer needs
     66 to include these libraries in the app.</li>
     67 <li><strong>Vulkan Runtime </strong><em>(provided by Android)</em>. A native
     68 library <code>(libvulkan.so</code>) that provides a new public native API
     69 called <a href="https://www.khronos.org/vulkan">Vulkan</a>. Most functionality
     70 is implemented by a driver provided by the GPU vendor; the runtime wraps the
     71 driver, provides API interception capabilities (for debugging and other
     72 developer tools), and manages the interaction between the driver and platform
     73 dependencies such as BufferQueue.</li>
     74 <li><strong>Vulkan Driver </strong><em>(provided by SoC)</em>. Maps the Vulkan
     75 API onto hardware-specific GPU commands and interactions with the kernel
     76 graphics driver.</li>
     77 </ul>
     78 
     79 <h2 id=modified_components>Modified components</h2>
     80 <p>Android 7.0 modifies the following existing graphics components to support
     81 Vulkan:</p>
     82 
     83 <ul>
     84 <li><strong>BufferQueue</strong>. The Vulkan Runtime interacts with the existing
     85 BufferQueue component via the existing <code>ANativeWindow</code> interface.
     86 Includes minor modifications (new enum values and new methods) to
     87 <code>ANativeWindow</code> and BufferQueue, but no architectural changes.</li>
     88 <li><strong>Gralloc HAL</strong>. Includes a new, optional interface for
     89 discovering whether a given format can be used for a particular
     90 producer/consumer combination without actually allocating a buffer.</li>
     91 </ul>
     92 
     93 <p>For details on these components, see
     94 <a href="{@docRoot}devices/graphics/arch-bq-gralloc.html">BufferQueue and
     95 gralloc</a> (for details on <code>ANativeWindow</code>, see
     96 <a href="{@docRoot}devices/graphics/arch-egl-opengl.html">EGLSurface and OpenGL
     97 ES</a>).
     98 
     99 <h2 id=apis>Vulkan API</h2>
    100 <p>The Android platform includes an
    101 <a href="https://developer.android.com/ndk/guides/graphics/index.html">Android-specific
    102 implementation</a> of the <a href="https://www.khronos.org/vulkan/">Vulkan API
    103 specification</a> from the Khronos Group. Android applications must use the
    104 <a href="{@docRoot}devices/graphics/implement-vulkan.html#wsi">Window System
    105 Integration (WSI) extensions</a> to output their rendering.</p>
    106 
    107 <h2 id=resources>Resources</h2>
    108 <p>Use the following resources to learn more about Vulkan:</p>
    109 <ul>
    110 
    111 <li>
    112 <a href="https://googleplex-android.git.corp.google.com/platform/frameworks/native/+/nyc-dr1-release/vulkan/#">Vulkan
    113 Loader </a>(libvulkan.so) at <code>platform/frameworks/native/vulkan</code>.
    114 Contains Android's Vulkan loader, as well as some Vulkan-related tools useful to
    115 platform developers.</li>
    116 
    117 <li><a href="https://android.googlesource.com/platform/frameworks/native/+/master/vulkan/doc/implementors_guide/implementors_guide.html">Vulkan
    118 Implementor's Guide</a>. Intended for GPU IHVs writing Vulkan drivers for
    119 Android and OEMs integrating those drivers for specific devices. It describes
    120 how a Vulkan driver interacts with the system, how GPU-specific tools should be
    121 installed, and Android-specific requirements.</li>
    122 
    123 <li><a href="https://developer.android.com/ndk/guides/graphics/index.html">Vulkan
    124 Graphics API Guide</a>. Includes information on getting started with using
    125 Vulkan in an Android app, details on Vulkan design guidelines on the Android
    126 platform, how to use Vulkan's shader compilers, and how to use use validation
    127 layers to help assure stability in apps using Vulkan.</li>
    128 
    129 <li><a href="https://www.khronos.org/#slider_vulkan">Vulkan News</a>. Covers
    130 events, patches, tutorials, and more Vulkan-related news articles.</li>
    131 </ul>
    132