LunarG

Copyright © 2015-2022 LunarG, Inc.

Creative Commons

VK_LAYER_LUNARG_screenshot

The VK_LAYER_LUNARG_screenshot layer records frames to image files.

Configuring the Screenshot Layer

For an overview of how to configure layers, refer to the Layers Overview and Configuration document.

The Screenshot Layer settings are documented in the Layer Details section below.

The Screenshot Layer can also be enabled and configured using the Vulkan Configurator included with the Vulkan SDK.

Android

Frame numbers can be specified with the debug.vulkan.screenshot.frames property:

adb shell setprop debug.vulkan.screenshot.frames <framenumbers>

The directory in which to create the image files can be specified with the debug.vulkan.screenshot.dir property:

adb shell setprop debug.vulkan.screenshot.dir <directory>

If debug.vulkan.screenshot.dir is not set or it is set to an empty string, the value of debug.vulkan.screenshot.dir will default to "/sdcard/Android".

For production builds, if the files are to be written to external storage, make sure your application is able to read and write external storage by adding the following to AndroidManifest.xml:

<!-- This allows writing log files to sdcard -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

You may also need to grant it access with package manager. For example, using the Vulkan Cube demo from Khronos/Vulkan-Tools:

adb shell pm grant com.example.VkCube android.permission.READ_EXTERNAL_STORAGE
adb shell pm grant com.example.VkCube android.permission.WRITE_EXTERNAL_STORAGE

Layer Settings

The options for this layer are specified in VK_LAYER_LUNARG_screenshot.json. The layer option details are documented in the screenshot layer documentation.