This subdirectory contains Android's Vulkan loader, as well as some Vulkan-related tools useful to platform developers.
The former contents of doc/implementors_guide/ are now at https://source.android.com/devices/graphics/implement-vulkan.
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.
We generate several parts of the loader and tools directly from the Vulkan Registry (external/vulkan-headers/registry/vk.xml). Code generation must be done manually because the generator is not part of the platform toolchain (yet?). Files named foo_gen.* are generated by the code generator.
Install Python3 (if not already installed) and execute below: $ ./scripts/code_generator.py
This guide outlines the three main parts for updating the Vulkan EDI pipeline.
vk.py and vkjson_*.cc files$ANDROID_BUILD_TOP/frameworks/native/vulkanpython3 scripts/vkjson_codegen.py$ANDROID_BUILD_TOP/ctspython3 common/device-side/device-info/src/com/android/compatibility/common/deviceinfo/scripts/code_generator.py$ANDROID_BUILD_TOP # Build the necessary CTS modules
mmma cts/tools/cts-device-info/ cts/common/device-side/device-info
# Install the collector APK. Note: The path depends on your lunch target.
adb install -r -g out/target/product/<target_name>/testcases/CtsDeviceInfo/arm64/CtsDeviceInfo.apk
# Run the instrumented test to generate the file on the device
adb shell am instrument --no-isolated-storage -w \
-e class com.android.compatibility.common.deviceinfo.VulkanDeviceInfo \
com.android.compatibility.common.deviceinfo/androidx.test.runner.AndroidJUnitRunner
# Pull the generated JSON from the device
adb pull /sdcard/device-info-files/VulkanDeviceInfo.deviceinfo.json
Next, move to your google3 workspace to update the source files and run the final proto generator script.
Update vk.py: Copy the vk.py from $ANDROID_BUILD_TOP/frameworks/native/vulkan/scripts file to wireless/android/partner/adl/proto/scripts/.
vk.py file, add a comment in the file to disable lint errors - # pylint: disable=allUpdate VulkanDeviceInfo.deviceinfo.json: Copy the JSON file generated in the previous step (A) to javatests/com/google/wireless/android/partner/adl/pipeline/extendeddeviceinfo/.
Run Generator: Execute the following command to update the .proto files, apfe.sdl, and the ExtendedDeviceInfoTest.java test file.
google3python3 wireless/android/partner/adl/proto/scripts/vulkan_proto_gen.py