commit | 3ba84017a953c88c9951f8b63a2a506ca6fd0765 | [log] [tgz] |
---|---|---|
author | dan sinclair <dj2@everburning.com> | Wed Apr 17 08:14:53 2019 -0400 |
committer | GitHub <noreply@github.com> | Wed Apr 17 08:14:53 2019 -0400 |
tree | 844cd269afa8bc7f3b67df53d21677d6f57c60b6 | |
parent | 2dcaa50fcc7a41adab57508b3f7f634f5b4ec44b [diff] |
Flush out some class/method documentation. (#476) This CL adds class/method documentation to a few more classes.
Amber is a multi-API shader test framework.
Amber lets you capture and communicate shader bugs with the fluidity and ease of a scripting flow:
Amber is influenced by Talvos and VkRunner. The VkScript syntax matches the format used by VkRunner.
This is not an officially supported Google product.
git clone https://github.com/google/amber.git cd amber ./tools/git-sync-deps mkdir -p out/Debug cd out/Debug cmake -GNinja ../.. ninja
ANDROID_PLATFORM
and ANDROID_BUILD_TOOL_VERSION
in tools/build-amber-sample.sh
.export ANDROID_SDK_HOME=path/to/Android/SDK
in your shell.export ANDROID_NDK_HOME=path/to/Android/NDK
in your shell.keytool
command and set up KEY_STORE_PATH
env variable for the KeyStore file path../tools/build-amber-sample.sh [build output directory path]
.It is possible to obtain a plain executable for Android, as opposed to an APK, with the following:
git clone https://github.com/google/amber.git cd amber ./tools/git-sync-deps ./tools/update_build_version.py . samples/ third_party/ ./tools/update_vk_wrappers.py . . mkdir build cd build mkdir app mkdir libs ${ANDROID_NDK_HOME}/ndk-build -C ../samples NDK_PROJECT_PATH=. NDK_LIBS_OUT=`pwd`/libs NDK_APP_OUT=`pwd`/app
The list of target ABIs can be configured in samples/jni/Application.mk
by editing the APP_ABI entry:
APP_ABI := arm64-v8a armeabi-v7a x86 x86_64
The resulting executable will be produced as build/app/local/<abi>/amber_ndk
. This executable can be run via the adb shell on your device, e.g. under /data/local/tmp
(/sdcard
is generally not suitable because it is mounted with a non-executable flag). Also, vulkan layers may not be available to this executable as it is not an app, so make sure to use the -d
flag to disable Vulkan layers:
adb push build/app/local/<abi>/amber_ndk /data/local/tmp adb shell # Now on device shell cd /data/local/tmp ./amber_ndk -d <shader-test-files>
Amber, by default, enables testing, SPIRV-Tools and Shaderc. Each of these can be disabled by using the appropriate flags to CMake. Note, disabling SPIRV-Tools will disable Shaderc automatically.
The available flags which can be defined are:
cmake -DAMBER_SKIP_TESTS=True -DAMBER_SKIP_SPIRV_TOOLS=True -GNinja ../..
There are a number of build bots to verify Amber continues to compile and run on the various targets. Due to bot limitations, the integration tests are not being run on the bots, just the unit tests.
Amber is designed to run against different graphics APIs. Amber will build if no graphics API is found, but will only allow verifying the syntax of the amber script files.
Currently the Vulkan and Dawn graphics APIs are supported.
A Vulkan implementation is found by CMake in the following priority order:
First: If an enclosing CMake project includes the Vulkan-Headers CMake project, then headers will be picked up from there.
In this case the CMake variable Vulkan_LIBRARIES
can name the Vulkan library, or a default of vulkan
will be used.
Second: If you have CMake 3.7 or later, then the Vulkan implementation will be found from a Vulkan SDK as published by LunarG.
Environment variables:
VULKAN_SDK
should point to the platform-specific SDK directory that contains the include
and lib
directories.VK_ICD_FILENAMES
should point to the ICD JSON file.VK_LAYER_PATH
should point to the explicit_layer.d folder.LD_LIBRARY_PATH
must contain the $VULKAN_SDK/lib/ folder for the validation libraries.export VULKAN_SDK=$HOME/vulkan-macos-1.1.85.0/macOS export VK_ICD_FILENAMES=$VULKAN_SDK/etc/vulkan/icd.d/MoltenVK_icd.json export VK_LAYER_PATH=$VULKAN_SDK/etc/vulkan/explicit_layer.d export LD_LIBRARY_PATH=$VULKAN_SDK/lib:$LD_LIBRARY_PATH
We assume you have built Dawn from source, and have access to both the source and build trees. To build a Dawn backend for Amber, set the following CMake variables when configuring Amber:
Dawn_INCLUDE_DIR
: The directory containing dawn/dawn_export.h
(in the source tree).Dawn_GEN_INCLUDE_DIR
: The directory containing generated header dawn/dawncpp.h
(in the build output tree).Dawn_LIBRARY_DIR
: The directory containing the dawn_native
library (in the build output tree).The build will generate an out/Debug/amber
executable which can be used to run amber scripts. The script can be used as out/Debug/amber <path to amber file>
. Where, currently, the amber file is in the VkScript format.
out/Debug/amber tests/cases/clear.vkscript
The sample app returns a value of 0 on success or non-zero on error. Any issues encountered should be displayed on the console.
Please see the CONTRIBUTING and CODE_OF_CONDUCT files on how to contribute to Amber.