1A Vulkan layer to display information about the running application using an overlay. 2 3Building 4======== 5 6The overlay layer will be built if :code:`screenshot` is passed as a :code:`vulkan-layers` argument. For example: 7 8.. code-block:: sh 9 10 meson -Dvulkan-layers=device-select,screenshot builddir/ 11 ninja -C builddir/ 12 sudo ninja -C builddir/ install 13 14See `docs/install.rst <https://gitlab.freedesktop.org/mesa/mesa/-/blob/master/docs/install.rst>`__ for more information. 15 16Basic Usage 17=========== 18 19Turn on the layer: 20 21.. code-block:: sh 22 23 VK_LOADER_LAYERS_ENABLE=VK_LAYER_MESA_screenshot /path/to/my_vulkan_app 24 25 26List the help menu: 27 28.. code-block:: sh 29 30 VK_LOADER_LAYERS_ENABLE=VK_LAYER_MESA_screenshot VK_LAYER_MESA_SCREENSHOT_CONFIG=help /path/to/my_vulkan_app 31 32Enable log output in stdout/stderr: 33 34.. code-block:: sh 35 36 VK_LOADER_LAYERS_ENABLE=VK_LAYER_MESA_screenshot VK_LAYER_MESA_SCREENSHOT_CONFIG=log_type=<info|debug> /path/to/my_vulkan_app 37 38Redirect screenshots taken to a different directory: 39 40.. code-block:: sh 41 42 VK_LOADER_LAYERS_ENABLE=VK_LAYER_MESA_screenshot VK_LAYER_MESA_SCREENSHOT_CONFIG=output_dir=/path/to/new_dir /path/to/my_vulkan_app 43 44Capture pre-determined screenshots: 45 46.. code-block:: sh 47 48 VK_LOADER_LAYERS_ENABLE=VK_LAYER_MESA_screenshot VK_LAYER_MESA_SCREENSHOT_CONFIG=frames=1/5/7/15-4-5 /path/to/my_vulkan_app 49 50Note: 51 - Individual frames are separated by '/' and must be listed before the frame range 52 - The frame range is determined by <range start>-<range count>-<range interval> 53 - Example: '1/5/7/15-4-5' gives individual frames [1,5,7], then the frame range gives [15,20,25,30], combining into [1,5,7,15,20,25,30] 54 55To capture all frames: 56 57.. code-block:: sh 58 59 VK_LOADER_LAYERS_ENABLE=VK_LAYER_MESA_screenshot VK_LAYER_MESA_SCREENSHOT_CONFIG=frames=all /path/to/my_vulkan_app 60 61Direct Socket Control 62--------------------- 63 64Enabling communication with the client can be done with the following setup: 65 66.. code-block:: sh 67 68 VK_LOADER_LAYERS_ENABLE=VK_LAYER_MESA_screenshot VK_LAYER_MESA_SCREENSHOT_CONFIG=comms /path/to/my_vulkan_app 69 70The Unix socket may be used directly if needed. Once a client connects to the socket, the overlay layer will immediately 71send the following commands to the client: 72 73.. code-block:: sh 74 75 :MesaOverlayControlVersion=1; 76 :DeviceName=<device name>; 77 :MesaVersion=<mesa version>; 78 79The client connected to the overlay layer can trigger a screenshot to be taken by sending the command: 80 81.. code-block:: sh 82 83 :capture=<screenshot_name.png>; 84 85Note that the screenshot name must include '.png', other image types are not supported. 86 87.. _docs/install.rst: ../../docs/install.rst 88