Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 9025bfb

Browse files
authored
[Impeller] updated validation layers documentation (#44328)
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
1 parent 26b9d3b commit 9025bfb

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed
Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
# Android Vulkan Validation Layers
22

3-
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.
3+
If you want to run Vulkan Validation Layers with a custom engine build you need
4+
to add the `--enable-vulkan-validation-layers` to the `gn` invocation to make
5+
sure the layers are built and injected into the Flutter jar.
46

5-
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`.
6-
2. When you unzip the file, you will see: `arm64-v8a armeabi-v7a x86 x86_64`
7-
3. Copy these directories to `${FLUTTER_APP}/android/app/src/main/vklibs`. The layout should look similar to:
7+
Example:
88

9-
```
10-
src/main/vklibs/
11-
arm64-v8a/
12-
libVkLayer_khronos_validation.so
13-
armeabi-v7a/
14-
libVkLayer_khronos_validation.so
15-
x86/
16-
libVkLayer_khronos_validation.so
17-
x86-64/
18-
libVkLayer_khronos_validation.so
9+
```sh
10+
flutter/tools/gn \
11+
--runtime-mode=debug \
12+
--enable-impeller-vulkan \
13+
--enable-vulkan-validation-layers \
14+
--no-lto \
15+
--unoptimized \
16+
--android \
17+
--android-cpu=arm64
1918
```
2019

21-
4. Add the following line to `${FLUTTER_APP}/android/app/build.gradle`, `android > sourceSets` section: `main.jniLibs.srcDirs += 'src/main/vklibs'`.
20+
Then adding the following field to the
21+
`android/app/src/main/AndroidManifest.xml` will turn them on:
2222

23-
5. This should enable Vulkan validation layers on your Android application.
23+
```xml
24+
<meta-data
25+
android:name="io.flutter.embedding.android.EnableVulkanValidation"
26+
android:value="true" />
27+
```

0 commit comments

Comments
 (0)