1bf215546Sopenharmony_ciA Vulkan layer to display information about the running application using an overlay.
2bf215546Sopenharmony_ci
3bf215546Sopenharmony_ciBuilding
4bf215546Sopenharmony_ci=======
5bf215546Sopenharmony_ci
6bf215546Sopenharmony_ciThe overlay layer will be built if :code:`overlay` is passed as a :code:`vulkan-layers` argument. For example:
7bf215546Sopenharmony_ci
8bf215546Sopenharmony_ci.. code-block:: sh
9bf215546Sopenharmony_ci
10bf215546Sopenharmony_ci  meson -Dvulkan-layers=device-select,overlay builddir/
11bf215546Sopenharmony_ci  ninja -C builddir/
12bf215546Sopenharmony_ci  sudo ninja -C builddir/ install
13bf215546Sopenharmony_ci
14bf215546Sopenharmony_ciSee `docs/install.rst <https://gitlab.freedesktop.org/mesa/mesa/-/blob/master/docs/install.rst>`__ for more information.
15bf215546Sopenharmony_ci
16bf215546Sopenharmony_ciBasic Usage
17bf215546Sopenharmony_ci=======
18bf215546Sopenharmony_ci
19bf215546Sopenharmony_ciTurn on the layer:
20bf215546Sopenharmony_ci
21bf215546Sopenharmony_ci.. code-block:: sh
22bf215546Sopenharmony_ci
23bf215546Sopenharmony_ci  VK_INSTANCE_LAYERS=VK_LAYER_MESA_overlay /path/to/my_vulkan_app
24bf215546Sopenharmony_ci
25bf215546Sopenharmony_ci
26bf215546Sopenharmony_ciList the available statistics:
27bf215546Sopenharmony_ci
28bf215546Sopenharmony_ci.. code-block:: sh
29bf215546Sopenharmony_ci
30bf215546Sopenharmony_ci  VK_INSTANCE_LAYERS=VK_LAYER_MESA_overlay VK_LAYER_MESA_OVERLAY_CONFIG=help /path/to/my_vulkan_app
31bf215546Sopenharmony_ci
32bf215546Sopenharmony_ci
33bf215546Sopenharmony_ciTurn on some statistics:
34bf215546Sopenharmony_ci
35bf215546Sopenharmony_ci.. code-block:: sh
36bf215546Sopenharmony_ci
37bf215546Sopenharmony_ci  VK_INSTANCE_LAYERS=VK_LAYER_MESA_overlay VK_LAYER_MESA_OVERLAY_CONFIG=submit,draw,pipeline_graphics /path/to/my_vulkan_app
38bf215546Sopenharmony_ci
39bf215546Sopenharmony_ciPosition the overlay:
40bf215546Sopenharmony_ci
41bf215546Sopenharmony_ci.. code-block:: sh
42bf215546Sopenharmony_ci
43bf215546Sopenharmony_ci  VK_INSTANCE_LAYERS=VK_LAYER_MESA_overlay VK_LAYER_MESA_OVERLAY_CONFIG=submit,draw,pipeline_graphics,position=top-right /path/to/my_vulkan_app
44bf215546Sopenharmony_ci
45bf215546Sopenharmony_ciLogging Statistics
46bf215546Sopenharmony_ci=======
47bf215546Sopenharmony_ci
48bf215546Sopenharmony_ciLog statistics to a file:
49bf215546Sopenharmony_ci
50bf215546Sopenharmony_ci.. code-block:: sh
51bf215546Sopenharmony_ci
52bf215546Sopenharmony_ci  VK_INSTANCE_LAYERS=VK_LAYER_MESA_overlay VK_LAYER_MESA_OVERLAY_CONFIG=output_file=/tmp/output.txt /path/to/my_vulkan_app
53bf215546Sopenharmony_ci
54bf215546Sopenharmony_ciLogging is enabled for the entire lifecycle of the process unless a control socket is specified (see below).
55bf215546Sopenharmony_ci
56bf215546Sopenharmony_ci**Note:** some statistics (e.g. :code:`frame_timing` and :code:`gpu_timing`) log values for the entire sample interval instead of per-frame.
57bf215546Sopenharmony_ciFor these statistics, logging the :code:`frame` statistic allows one to compute per-frame statistics after capture.
58bf215546Sopenharmony_ci
59bf215546Sopenharmony_ciLog statistics to a file, controlling when such statistics will start to be captured:
60bf215546Sopenharmony_ci
61bf215546Sopenharmony_ci.. code-block:: sh
62bf215546Sopenharmony_ci
63bf215546Sopenharmony_ci  VK_INSTANCE_LAYERS=VK_LAYER_MESA_overlay VK_LAYER_MESA_OVERLAY_CONFIG=output_file=/tmp/output.txt,control=mesa_overlay /path/to/my_vulkan_app
64bf215546Sopenharmony_ci
65bf215546Sopenharmony_ciThe command above will open a Unix socket with the abstract path :code:`mesa_overlay`. When a control socket is specified,
66bf215546Sopenharmony_cilogging must be explicitly enabled through the control socket. :code:`mesa-overlay-control.py` provides a convenient CLI:
67bf215546Sopenharmony_ci
68bf215546Sopenharmony_ci.. code-block:: sh
69bf215546Sopenharmony_ci
70bf215546Sopenharmony_ci  mesa-overlay-control.py start-capture
71bf215546Sopenharmony_ci
72bf215546Sopenharmony_ci.. code-block:: sh
73bf215546Sopenharmony_ci
74bf215546Sopenharmony_ci  mesa-overlay-control.py stop-capture
75bf215546Sopenharmony_ci
76bf215546Sopenharmony_ciDirect Socket Control
77bf215546Sopenharmony_ci------
78bf215546Sopenharmony_ci
79bf215546Sopenharmony_ciThe Unix socket may be used directly if needed. Once a client connects to the socket, the overlay layer will immediately
80bf215546Sopenharmony_cisend the following commands to the client:
81bf215546Sopenharmony_ci
82bf215546Sopenharmony_ci.. code-block:: sh
83bf215546Sopenharmony_ci
84bf215546Sopenharmony_ci  :MesaOverlayControlVersion=1;
85bf215546Sopenharmony_ci  :DeviceName=<device name>;
86bf215546Sopenharmony_ci  :MesaVersion=<mesa version>;
87bf215546Sopenharmony_ci
88bf215546Sopenharmony_ciThe client connected to the overlay layer can enable statistics capturing by sending the command:
89bf215546Sopenharmony_ci
90bf215546Sopenharmony_ci.. code-block:: sh
91bf215546Sopenharmony_ci
92bf215546Sopenharmony_ci  :capture=1;
93bf215546Sopenharmony_ci
94bf215546Sopenharmony_ciAnd disable it by sending:
95bf215546Sopenharmony_ci
96bf215546Sopenharmony_ci.. code-block:: sh
97bf215546Sopenharmony_ci
98bf215546Sopenharmony_ci  :capture=0;
99bf215546Sopenharmony_ci
100bf215546Sopenharmony_ci.. _docs/install.rst: ../../docs/install.rst
101