platform_frameworks_native/vulkan
Peter Collingbourne 6a303d8c1b Merge "Expand HWVULKAN_HARDWARE_MODULE_ID macro." am: d8a5c01345
Change-Id: Idc7eaa708b1a5eb63f7dca48c62d654a2e8b83de
2020-04-23 23:22:25 +00:00
..
api libvulkan: Rev 8 of ANDROID_native_buffer 2019-04-17 15:28:47 -07:00
doc vulkan: Move implementor's guide to s.a.c. 2018-05-09 16:23:53 -07:00
include Use upstream Vulkan headers from external/vulkan-headers 2019-04-18 14:42:36 -07:00
libvulkan Merge "Expand HWVULKAN_HARDWARE_MODULE_ID macro." am: d8a5c01345 2020-04-23 23:22:25 +00:00
nulldrv Replace more -Weverything with -Wextra 2019-11-09 00:56:40 +00:00
tools Replace more -Weverything with -Wextra 2019-11-09 00:56:40 +00:00
vkjson Prepare for moving Vulkan headers 2019-04-18 14:42:26 -07:00
.clang-format vulkan: initial loader and null driver 2016-01-25 13:49:31 -08:00
Android.bp Use upstream Vulkan headers from external/vulkan-headers 2019-04-18 14:42:36 -07:00
OWNERS Add opengl owners 2018-12-21 15:14:42 -08:00
README.md vulkan: rewrite top of loader 2016-03-30 09:42:47 +08:00

frameworks/native/vulkan

This subdirectory contains Android's Vulkan loader, as well as some Vulkan-related tools useful to platform developers.

Coding Style

We follow the Chromium coding style for naming and formatting, except with four-space indentation instead of two spaces. In general, any C++ features supported by the prebuilt platform toolchain are allowed.

Use "clang-format -style=file" to format all C/C++ code, except code imported verbatim from elsewhere. Setting up git-clang-format in your environment is recommended.

Code Generation

We generate several parts of the loader and tools from a Vulkan API description file, stored in api/vulkan.api. Code generation must be done manually because the generator tools aren't part of the platform toolchain (yet?). Files named foo_gen.* are generated from the API file and a template file named foo.tmpl.

To run the generator:

One-time setup

  • Install golang, if you don't have it already.
  • Create a directory (e.g. $HOME/lib/go) for local go sources and binaries and add it to $GOPATH.
  • $ git clone https://android.googlesource.com/platform/tools/gpu $GOPATH/src/android.googlesource.com/platform/tools/gpu
  • $ go get android.googlesource.com/platform/tools/gpu/api/...
  • You should now have $GOPATH/bin/apic. You might want to add $GOPATH/bin to your $PATH.

Generating code

To generate libvulkan/*_gen.*,

  • $ cd libvulkan
  • $ apic template ../api/vulkan.api code-generator.tmpl Similar for nulldrv/null_driver_gen.*.