forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Impeller] updated validation layers documentation (flutter#44328)
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
- Loading branch information
Showing
1 changed file
with
20 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,27 @@ | ||
# Android Vulkan Validation Layers | ||
|
||
This is a quick guide to get Vulkan validation layers support for a Flutter application. This guide assumes that you've created the application with `flutter create`, otherwise the locations might vary. | ||
If you want to run Vulkan Validation Layers with a custom engine build you need | ||
to add the `--enable-vulkan-validation-layers` to the `gn` invocation to make | ||
sure the layers are built and injected into the Flutter jar. | ||
|
||
1. Download the validation layers from this [GitHub](https://github.com/KhronosGroup/Vulkan-ValidationLayers/releases) releases. Typically named `android-binaries-1.3.231.1.zip`. | ||
2. When you unzip the file, you will see: `arm64-v8a armeabi-v7a x86 x86_64` | ||
3. Copy these directories to `${FLUTTER_APP}/android/app/src/main/vklibs`. The layout should look similar to: | ||
Example: | ||
|
||
``` | ||
src/main/vklibs/ | ||
arm64-v8a/ | ||
libVkLayer_khronos_validation.so | ||
armeabi-v7a/ | ||
libVkLayer_khronos_validation.so | ||
x86/ | ||
libVkLayer_khronos_validation.so | ||
x86-64/ | ||
libVkLayer_khronos_validation.so | ||
```sh | ||
flutter/tools/gn \ | ||
--runtime-mode=debug \ | ||
--enable-impeller-vulkan \ | ||
--enable-vulkan-validation-layers \ | ||
--no-lto \ | ||
--unoptimized \ | ||
--android \ | ||
--android-cpu=arm64 | ||
``` | ||
|
||
4. Add the following line to `${FLUTTER_APP}/android/app/build.gradle`, `android > sourceSets` section: `main.jniLibs.srcDirs += 'src/main/vklibs'`. | ||
Then adding the following field to the | ||
`android/app/src/main/AndroidManifest.xml` will turn them on: | ||
|
||
5. This should enable Vulkan validation layers on your Android application. | ||
```xml | ||
<meta-data | ||
android:name="io.flutter.embedding.android.EnableVulkanValidation" | ||
android:value="true" /> | ||
``` |