This has the same functionality as Tutorial 2, but building the validation layers from the Khronos Group Validation Layer source code hosted on the github repo.
The benefit is:
- You can peek/step into validation layers.
- You can observe the detailed status when validation layer finds issues in your app.
This can be useful for developers who want to know more about validation layers.
Building validation layers from sources currently requires NDK r25c or newer.
Developers should get the validation layer source from the github repo.
In this sample, the validation layers is wrapped into a gradle library module called layerlib
. The app
module depends on this layerlib
module.
The validation layer source code needs to be pulled in on command line before building the sample. Steps:
- cd tutorial03_traceable_layers/layerlib
- git clone --recursive https://github.com/KhronosGroup/Vulkan-ValidationLayers.git
- Make sure the
cmake
binary is on yourPATH
environment variable. - Open this sample with Android Studio with "Open an Existing Project" option
- Sync the project with Gradle Files. This can take 3-5 minutes to sync.
- Build the project, and start debugging (Run > Debug App). It can take 5-10 minutes to build.
Once the app triggers validation layer assert (embedded on purpose inside this sample in the app), you can see the stack frames in the Android Studio IDE debugger. You can also step into the validation layer, and check the values of all variables.
- Automatically pull the source code automatically in Gradle.