Full Code of flightlessmango/MangoHud for AI

master f2e45e9f2a36 cached
187 files
2.2 MB
596.7k tokens
1003 symbols
1 requests
Download .txt
Showing preview only (2,383K chars total). Download the full file or copy to clipboard to get everything.
Repository: flightlessmango/MangoHud
Branch: master
Commit: f2e45e9f2a36
Files: 187
Total size: 2.2 MB

Directory structure:
gitextract_zt6zshhe/

├── .editorconfig
├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   └── -bug-report----issue.md
│   ├── dependabot.yml
│   └── workflows/
│       ├── arch-package.yml
│       ├── build-package.yml
│       ├── build-source.yml
│       ├── mingw.yml
│       ├── param-check.yml
│       └── ubuntu.yml
├── .gitignore
├── .gitmodules
├── LICENSE
├── README.md
├── bin/
│   ├── gen_enum_to_str.py
│   ├── mangohud-setup.sh
│   ├── mangohud.in
│   ├── mangoplot.py
│   ├── meson.build
│   ├── vk_dispatch_table_gen.py
│   ├── vk_entrypoints.py
│   ├── vk_extensions.py
│   └── vk_extensions_gen.py
├── build-source.sh
├── build-srt.sh
├── build-with-srt-docker.sh
├── build.sh
├── build_deps.sh
├── control/
│   ├── setup.cfg
│   ├── setup.py
│   └── src/
│       └── control/
│           └── __init__.py
├── data/
│   ├── MangoHud.conf
│   ├── io.github.flightlessmango.mangohud.metainfo.xml
│   ├── mangoapp.1
│   ├── mangohud.1
│   ├── meson.build
│   └── presets.conf
├── include/
│   ├── .editorconfig
│   ├── IconsForkAwesome.h
│   ├── KHR/
│   │   └── khrplatform.h
│   ├── elfhacks.h
│   ├── filesystem.h
│   ├── glad/
│   │   └── glad.h
│   ├── nvml.h
│   └── vulkan/
│       └── vk_util.h
├── meson.build
├── meson_options.txt
├── mingw32.txt
├── mingw64.txt
├── pkgbuild/
│   └── PKGBUILD
├── src/
│   ├── amdgpu.cpp
│   ├── amdgpu.h
│   ├── app/
│   │   ├── control.c
│   │   ├── main.cpp
│   │   ├── mangoapp.h
│   │   └── mangoapp_proto.h
│   ├── battery.cpp
│   ├── battery.h
│   ├── blacklist.cpp
│   ├── blacklist.h
│   ├── config.cpp
│   ├── config.h
│   ├── control.cpp
│   ├── cpu.cpp
│   ├── cpu.h
│   ├── cpu_win32.cpp
│   ├── dbus.cpp
│   ├── dbus_helpers.h
│   ├── dbus_info.h
│   ├── device.cpp
│   ├── device.h
│   ├── elfhacks.c
│   ├── fcat.h
│   ├── fex.cpp
│   ├── fex.h
│   ├── file_utils.cpp
│   ├── file_utils.h
│   ├── file_utils_win32.cpp
│   ├── font.cpp
│   ├── font_default.h
│   ├── font_unispace.c
│   ├── forkawesome.h
│   ├── fps_limiter.h
│   ├── fps_metrics.h
│   ├── ftrace.cpp
│   ├── ftrace.h
│   ├── gl/
│   │   ├── gl.h
│   │   ├── gl_hud.cpp
│   │   ├── gl_hud.h
│   │   ├── gl_renderer.cpp
│   │   ├── gl_renderer.h
│   │   ├── glad.c
│   │   ├── inject_egl.cpp
│   │   ├── inject_glx.cpp
│   │   └── shim.c
│   ├── gpu.cpp
│   ├── gpu.h
│   ├── gpu_fdinfo.cpp
│   ├── gpu_fdinfo.h
│   ├── gpu_metrics_util.h
│   ├── hud_elements.cpp
│   ├── hud_elements.h
│   ├── imgui_utils.h
│   ├── iostats.cpp
│   ├── iostats.h
│   ├── keybinds.cpp
│   ├── keybinds.h
│   ├── loaders/
│   │   ├── loader_dbus.cpp
│   │   ├── loader_dbus.h
│   │   ├── loader_glx.cpp
│   │   ├── loader_glx.h
│   │   ├── loader_nvctrl.cpp
│   │   ├── loader_nvctrl.h
│   │   ├── loader_nvml.cpp
│   │   ├── loader_nvml.h
│   │   ├── loader_x11.cpp
│   │   └── loader_x11.h
│   ├── logging.cpp
│   ├── logging.h
│   ├── mangohud.json.in
│   ├── mangohud.version
│   ├── memory.cpp
│   ├── memory.h
│   ├── mesa/
│   │   ├── c11_compat.h
│   │   ├── c99_compat.h
│   │   ├── no_extern_c.h
│   │   └── util/
│   │       ├── detect_os.h
│   │       ├── macros.h
│   │       ├── os_socket.c
│   │       ├── os_socket.h
│   │       ├── os_time.c
│   │       └── os_time.h
│   ├── meson.build
│   ├── net.cpp
│   ├── net.h
│   ├── notify.cpp
│   ├── notify.h
│   ├── nvapi.cpp
│   ├── nvidia.cpp
│   ├── nvidia.h
│   ├── overlay.cpp
│   ├── overlay.frag
│   ├── overlay.h
│   ├── overlay.vert
│   ├── overlay_params.cpp
│   ├── overlay_params.h
│   ├── pci_ids.cpp
│   ├── pci_ids.h
│   ├── real_dlsym.c
│   ├── real_dlsym.h
│   ├── shared_x11.cpp
│   ├── shared_x11.h
│   ├── shell.cpp
│   ├── shell.h
│   ├── string_utils.h
│   ├── timing.hpp
│   ├── vulkan.cpp
│   ├── wayland_hook.h
│   ├── wayland_keybinds.cpp
│   ├── win/
│   │   ├── d3d11_hook.cpp
│   │   ├── d3d11_hook.h
│   │   ├── d3d12_hook.cpp
│   │   ├── d3d12_hook.h
│   │   ├── d3d_shared.cpp
│   │   ├── d3d_shared.h
│   │   ├── dxgi.cpp
│   │   ├── dxgi.h
│   │   ├── kiero.cpp
│   │   ├── kiero.h
│   │   ├── main.cpp
│   │   └── win_shared.h
│   └── winesync.h
├── steamrt.Dockerfile.in
├── subprojects/
│   ├── cmocka.wrap
│   ├── imgui.wrap
│   ├── implot.wrap
│   ├── minhook.wrap
│   ├── packagefiles/
│   │   ├── vulkan-headers/
│   │   │   └── meson.build
│   │   └── vulkan-utility-libraries/
│   │       └── meson.build
│   ├── spdlog.wrap
│   ├── vulkan-headers.wrap
│   └── vulkan-utility-libraries.wrap
├── tests/
│   ├── gpu_metrics
│   ├── gpu_metrics_apu
│   ├── gpu_metrics_invalid
│   ├── params.py
│   └── test_amdgpu.cpp
└── version.h.in

================================================
FILE CONTENTS
================================================

================================================
FILE: .editorconfig
================================================
# See http://editorconfig.org to read about the EditorConfig format.
# - Automatically supported by VS2017+ and most common IDE or text editors.
# - For older VS2010 to VS2015, install https://marketplace.visualstudio.com/items?itemName=EditorConfigTeam.EditorConfig

# top-most EditorConfig file
root = true

# Default settings:
# Use 4 spaces as indentation
[*]
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

[src/overlay*{cpp,h}]
indent_size = 3

[src/{keybinds,vulkan}.{cpp,h}]
indent_size = 3

[src/mesa/**]
indent_size = 3

[meson.build]
indent_size = 2


================================================
FILE: .github/ISSUE_TEMPLATE/-bug-report----issue.md
================================================
---
name: "[Bug report] - Issue"
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---


⚠️ **Do not report issues for unsupported or old MangoHud versions.**
Please verify the issue still occurs on the latest release before submitting.

---

## Describe the bug
A clear and concise description of what the bug is.

## System information
Please provide all relevant details.

- **Linux distribution**
- **Kernel version**
- **MangoHud version**
- **MangoHud config** (attach or paste if non default)
- **Launch options**
- **Application or game**
- **GPU model and driver**
- **Display server** (X11 or Wayland)

## Expected behavior
What you expected to happen.

## Actual behavior
What actually happened.

## Logs
Include log captured with `MANGOHUD_LOG_LEVEL=debug` set

Wrap logs in code blocks.

## Screenshots
If applicable, add screenshots to help explain the problem.

## Additional context
Any other information that might be useful.


================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "weekly"


================================================
FILE: .github/workflows/arch-package.yml
================================================
name: arch package

on:
  workflow_dispatch:

jobs:
  build-arch-pkg:
    runs-on: ubuntu-latest
    container:
      image: archlinux:latest
    steps:
      - name: set git global safe directory
        run: |
          pacman -Syu git --noconfirm
          git config --global --add safe.directory $(realpath .)
      - uses: actions/checkout@v3
      - name: Install prerequisites
        run: |
          echo "ParallelDownloads = 10" >> /etc/pacman.conf
          echo "\n" && echo "[multilib]" >> /etc/pacman.conf
          echo "Include = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf
          pacman -Syu base-devel sudo meson python-mako glslang hub python-numpy python-matplotlib --noconfirm
      - name: makepkg
        run: |
          useradd -m builduser
          echo "builduser ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/builduser
          chmod 0440 /etc/sudoers.d/builduser
          chown -R builduser:builduser pkgbuild
          cd pkgbuild
          pkgver=$(git describe --tags | sed -r 's/^v//;s/([^-]*-g)/r\1/;s/-/./g')
          sed -i "s/pkgver=.*/pkgver=$pkgver/g" PKGBUILD
          sudo -u builduser -- sh -c "makepkg -fsCc --noconfirm"
      - name: Edit release and add files
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          set -x
          assets=()
          for pkg in ./pkgbuild/*mangohud*.tar.zst;
            do echo $pkg;
            assets+=("-a" "$pkg")
          done;
          tag_name="${GITHUB_REF##*/}"
          hub release edit "${assets[@]}" -m "" "$tag_name"


================================================
FILE: .github/workflows/build-package.yml
================================================
name: Build release package
on:
  release:
    types: [published]

jobs:
  build:
    runs-on: ubuntu-24.04

    steps:
      - uses: actions/checkout@v3
      - name: Install build tools
        run: |
          set -x
          sudo dpkg --add-architecture i386
          sudo apt update
          sudo apt -y install gcc-multilib g++-multilib ninja-build python3-setuptools \
                              python3-wheel mesa-common-dev libxnvctrl-dev libdbus-1-dev \
                              python3-numpy python3-matplotlib unzip libxkbcommon-dev libwayland-dev wget unzip \
                              libxkbcommon-dev:i386 libwayland-dev:i386 gh python3-mako meson pkgconf pkg-config
          wget https://github.com/KhronosGroup/glslang/releases/download/SDK-candidate-26-Jul-2020/glslang-master-linux-Release.zip
          unzip glslang-master-linux-Release.zip bin/glslangValidator
          sudo install -m755 bin/glslangValidator /usr/local/bin/
          command -v pkg-config && pkg-config --version
      - name: Prepare Artifact Git Info
        shell: bash
        run: |
          echo "##[set-output name=branch;]${GITHUB_REF#refs/heads/}"
          ARTIFACT_NAME="commit-$(git rev-parse --short "$GITHUB_SHA")"
          if [ ${{ github.event_name == 'pull_request' }} ]; then
            echo "##[set-output name=short-sha;]$(git rev-parse --short "${{ github.event.pull_request.head.sha }}")"
            if [ ! -z "${{ github.event.pull_request.number }}" ]; then
              ARTIFACT_NAME="pr-${{ github.event.pull_request.number }}-commit-$(git rev-parse --short "${{ github.event.pull_request.head.sha }}")"
            fi
          else
            echo "##[set-output name=short-sha;]$(git rev-parse --short "$GITHUB_SHA")"
          fi
          echo "##[set-output name=artifact-metadata;]$ARTIFACT_NAME"
      - name: Build and package
        run: |
          ./build-source.sh
          ./build.sh build -Dwerror=true package release
      - name: Upload assets to release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          tag_name="${GITHUB_REF##*/}"
          for pkg in ./build/*.tar.*; do
            gh release upload "$tag_name" "$pkg" --clobber
          done

      - name: Upload artifact
        uses: actions/upload-artifact@v4
        continue-on-error: true
        with:
          name: MangoHud-${{steps.git-vars.outputs.artifact-metadata}}
          path: ${{runner.workspace}}/MangoHud/build/MangoHud-*tar.gz
          retention-days: 30


================================================
FILE: .github/workflows/build-source.yml
================================================
name: Build source tars
on:
  workflow_dispatch:
  release:
    types: [published]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3
      - name: Run build-source.sh
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          set -x
          sudo apt update
          sudo apt -y install gcc g++ ninja-build python3-pip python3-setuptools \
                         python3-wheel pkg-config mesa-common-dev libx11-dev \
                         libxnvctrl-dev libdbus-1-dev glslang-tools hub libxkbcommon-dev \
                         libwayland-dev wget unzip python3-mako meson
          ./build-source.sh
          assets=()
          for asset in ./MangoHud-*-Source*.tar.*; do
            assets+=("-a" "$asset")
          done
          tag_name="${GITHUB_REF##*/}"
          hub release edit "${assets[@]}" -m "" "$tag_name"
          #hub release create "${assets[@]}" -m "$tag_name" "$tag_name"
      - name: Upload artifact
        uses: actions/upload-artifact@v4
        continue-on-error: true
        with:
          name: MangoHud-${{steps.git-vars.outputs.artifact-metadata}}
          path: ${{runner.workspace}}/MangoHud/build/MangoHud-*tar.gz
          retention-days: 30


================================================
FILE: .github/workflows/mingw.yml
================================================
name: Mingw build testing

on: [push, pull_request]
jobs:
  build-mingw:
    runs-on: ubuntu-latest
    container:
      image: archlinux:latest
    steps:
      - uses: actions/checkout@v3
      - name: Install prerequisites
        run: |
          pacman -Syu mingw-w64-gcc meson python-mako glslang mingw-w64-headers git --noconfirm
      - name: configure
        run: meson setup --cross-file mingw64.txt build64
      - name: build
        run: ninja -C build64

================================================
FILE: .github/workflows/param-check.yml
================================================
name: param check

on:
  push:
    paths:
      - 'src/overlay_params.h'
      - 'README.md'
      - 'data/MangoHud.conf'

jobs:
  param-check:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code
      uses: actions/checkout@v3
    - name: Set up Python
      uses: actions/setup-python@v4
      with:
        python-version: '3.11.2' # Replace with the version of Python you want to use
    - name: Run Python script
      run: |
        cd tests
        python params.py


================================================
FILE: .github/workflows/ubuntu.yml
================================================
name: Ubuntu build testing

on: [push, pull_request]

jobs:
  build-test:
    strategy:
      matrix:
        compiler: [clang, gcc]
        os: [ubuntu-24.04]
    runs-on: ${{ matrix.os }}
    steps:
    - name: 'Checkout'
      uses: actions/checkout@v3
    - name: 'Install prerequisites'
      run: |
        sudo apt-get update
        sudo apt-get install -y \
          appstream \
          glslang-tools \
          ninja-build \
          python3-mako \
          python3-setuptools \
          python3-wheel \
          mesa-common-dev \
          libcmocka-dev \
          libdbus-1-dev \
          libglfw3-dev \
          libwayland-dev \
          libxnvctrl-dev \
          libxkbcommon-dev \
          meson
    - name: 'Install clang'
      if:  ${{ (matrix.compiler == 'clang') }}
      run: |
          sudo apt-get install -y clang
          echo "CC=clang" >> "$GITHUB_ENV"
          echo "CXX=clang++" >> "$GITHUB_ENV"
    - name: 'Install gcc'
      if:  ${{ (matrix.compiler == 'gcc') }}
      run: |
          sudo apt-get install -y gcc g++
          echo "CC=gcc" >> "$GITHUB_ENV"
          echo "CXX=g++" >> "$GITHUB_ENV"
    - name: 'Configure'
      run: meson setup ./builddir --prefix=/usr
          -D include_doc=true
          -D with_xnvctrl=enabled
          -D with_x11=enabled
          -D with_wayland=enabled
          -D with_dbus=enabled
          -D mangoapp=true
          -D mangohudctl=true
          -D tests=enabled
          --werror
    - name: 'Build'
      run: meson compile -C ./builddir || ninja -C ./builddir
    - name: 'Install'
      run: sudo meson install -C ./builddir


================================================
FILE: .gitignore
================================================
build
builddir
__pycache__
.vscode
MangoHud*.tar.*
pkg
mangohud*.tar.*
lib32-mangohud*.tar.*

# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

# subprojects
subprojects/packagecache/
subprojects/Vulkan-Headers-*/
subprojects/Vulkan-Utility-Libraries-*/
subprojects/imgui-*/
subprojects/spdlog-*/
subprojects/nlohmann_json-*/
subprojects/implot-*/
subprojects/cmocka/

#GNU Global Metadata
**/GPATH
**/GRTAGS
**/GTAGS


================================================
FILE: .gitmodules
================================================
[submodule "modules/minhook"]
	path = modules/minhook
	url = https://github.com/flightlessmango/minhook


================================================
FILE: LICENSE
================================================
MIT License

Copyright (c) 2020 flightlessmango

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: README.md
================================================
# MangoHud

A Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more.

![Example gif showing a standard performance readout with frametimes](assets/overlay_example.gif)

---

- [MangoHud](#mangohud)
  - [Installation - Build From Source](#installation---build-from-source)
    - [Dependencies](#dependencies)
    - [Building with build script](#building-with-build-script)
  - [Installation - Pre-packaged Binaries](#installation---pre-packaged-binaries)
    - [GitHub releases](#github-releases)
    - [Arch-based distributions](#arch-based-distributions)
    - [Debian, Ubuntu](#debian-ubuntu)
    - [Fedora](#fedora)
    - [Solus](#solus)
    - [openSUSE](#opensuse)
    - [Flatpak](#flatpak)
  - [Normal usage](#normal-usage)
  - [OpenGL](#opengl)
  - [Hud configuration](#hud-configuration)
    - [Environment Variables: **`MANGOHUD_CONFIG`**, **`MANGOHUD_CONFIGFILE`**, and **`MANGOHUD_PRESETSFILE`**](#environment-variables)
  - [Vsync](#vsync)
    - [OpenGL Vsync](#opengl-vsync)
    - [Vulkan Vsync](#vulkan-vsync)
  - [Keybindings](#keybindings)
  - [Workarounds](#workarounds)
  - [FPS logging](#fps-logging)
    - [Online visualization: FlightlessMango.com](#online-visualization-flightlessmangocom)
    - [Local visualization: `mangoplot`](#local-visualization-mangoplot)
  - [Metrics support by GPU vendor/driver](#metrics-support-by-gpu-vendordriver)

## Installation - Build From Source

---

If you wish to compile MangoHud to keep up to date with any changes - first clone this repository and cd into it:

```
git clone --recurse-submodules https://github.com/flightlessmango/MangoHud.git
cd MangoHud
```

Using `meson` to install "manually":

```
meson build
ninja -C build install
```

By default, meson should install MangoHud to `/usr/local`. Specify install prefix with `--prefix=/usr` if desired.
Add `-Dappend_libdir_mangohud=false` option to meson to not append `mangohud` to libdir if desired (e.g. /usr/local/lib/mangohud).

To install 32-bit build on 64-bit distro, specify proper `libdir`: `lib32` for Arch, `lib/i386-linux-gnu` on Debian-based distros. RPM-based distros usually install 32-bit libraries to `/usr/lib` and 64-bit to `/usr/lib64`.
You may have to change `PKG_CONFIG_PATH` to point to correct folders for your distro.

```
CC="gcc -m32" \
CXX="g++ -m32" \
PKG_CONFIG_PATH="/usr/lib32/pkgconfig:/usr/lib/i386-linux-gnu/pkgconfig:/usr/lib/pkgconfig" \
meson build32 --libdir lib32
ninja -C build32 install
```

### Dependencies

Install necessary development packages.

- gcc, g++
- or gcc-multilib, g++-multilib for 32-bit support
- meson >=0.54
- ninja (ninja-build)
- glslang
- libGL/libEGL (libglvnd, mesa-common-dev, mesa-libGL-devel etc)
- X11 (libx11-dev)
- XNVCtrl (libxnvctrl-dev), optional, use `-Dwith_xnvctrl=disabled` option with `meson` to disable
- D-Bus (libdbus-1-dev), optional, use `-Dwith_dbus=disabled` option with `meson` to disable
- wayland-client
- xkbcommon

Python 3 libraries:

- Mako (python3-mako or install with `pip`)

If distro's packaged `meson` is too old and gives build errors, install newer version with `pip` (`python3-pip`).

### Meson options

| Option        | Default | Description
| --------      | ------- | -
| with_nvml     | enabled    |Required for NVIDIA GPU metrics on wayland
| with_xnvctrl  | enabled    |Required for NVIDIA GPU metrics on older GPUs
| with_x11      | enabled    |Required for keybinds on x11
| with_wayland  | enabled    |Required for keybinds on wayland
| with_dbus     | enabled    |Required for using the media features
| mangoapp      | false      |Includes mangoapp
| mangohudctl   | false      |Include mangohudctl
| tests         | auto       |Includes tests
| mangoplot     | true       |Includes mangoplot


### Building with build script

You can also use `build.sh` script to do some things automatically like install dependencies, if distro is supported but it usually assumes you are running on x86_64 architecture.

To just build it, execute:

```
./build.sh build
```

You can also pass arguments to meson:

```
./build.sh build -Dwith_xnvctrl=disabled
```

Resulting files will be install to `./build/release` folder.

If you have compiled MangoHud from source, to install it, execute:

```
./build.sh install
```

You can then subsequently uninstall MangoHud via the following command

```
./build.sh uninstall
```

To tar up the resulting binaries into a package and create a release tar with installer script, execute:

```
./build.sh package release
```

or combine the commands, although `package` should also call `build` if it doesn't find the built libs:

```
./build.sh build package release
```

If you have built MangoHud before and suddenly it fails, you can try cleaning the `build` folder, execute:

```
./build.sh clean
```

Currently it just does `rm -fr build` and clears subprojects.

__NOTE: If you are running an Ubuntu-based, Arch-based, Fedora-based, or openSUSE-based distro, the build script will automatically detect and prompt you to install missing build dependencies. If you run into any issues with this please report them!__

## Installation - Pre-packaged Binaries

---

### GitHub releases

If you do not wish to compile anything, simply download the file under [Releases](https://github.com/flightlessmango/MangoHud/releases), extract it, and from within the extracted folder in terminal, execute:

```
./mangohud-setup.sh install
```

### Arch-based distributions

If you are using an Arch-based distribution, install [`mangohud`](https://archlinux.org/packages/extra/x86_64/mangohud/) and [`lib32-mangohud`](https://archlinux.org/packages/multilib/x86_64/lib32-mangohud/) from the `extra`/`multilib` repository. [`mangohud-git`](https://aur.archlinux.org/packages/mangohud-git/) and [`lib32-mangohud-git`](https://aur.archlinux.org/packages/lib32-mangohud-git/) are available on the AUR to be installed via your favourite AUR helper. These can help fix issues with the hud not activating when using stable releases from pacman!

If you are building it by yourself, you need to enable multilib repository, by editing pacman config:

```
sudo nano /etc/pacman.conf
```

and uncomment:

```txt
#[multilib]
#Include = /etc/pacman.d/mirrorlist
```

then save the file and execute:

```
sudo pacman -Syy
```

### Debian, Ubuntu

If you are using Debian 11 (Bullseye) or later, Ubuntu 21.10 (Impish) or later, or distro derived from them, to install the [MangoHud](https://tracker.debian.org/pkg/mangohud) package, execute:

```
sudo apt install mangohud
```

Optionally, if you also need MangoHud for 32-bit applications,
on Debian you can execute:

```
sudo apt install mangohud:i386
```

The 32-bit package is not available on Ubuntu.

### Fedora

If you are using Fedora, to install the [MangoHud](https://src.fedoraproject.org/rpms/mangohud) package, execute:

```
sudo dnf install mangohud
```

### Solus

If you are using Solus, to install [MangoHud](https://dev.getsol.us/source/mangohud/) simply execute:

```
sudo eopkg it mangohud
```

### openSUSE

If you run openSUSE Leap or Tumbleweed you can get Mangohud from the official repositories.
There are two packages, [mangohud](https://software.opensuse.org/package/mangohud) for 64bit and [mangohud-32bit](https://software.opensuse.org/package/mangohud-32bit) for 32bit application support.
To have Mangohud working for both 32bit and 64bit applications you need to install both packages even on a 64bit operating system.

```
sudo zypper in mangohud mangohud-32bit
```

Leap doesn't seem to have the 32bit package.

Leap 15.2

```
sudo zypper addrepo -f https://download.opensuse.org/repositories/games:tools/openSUSE_Leap_15.2/games:tools.repo
sudo zypper install mangohud
```

Leap 15.3

```
sudo zypper addrepo -f https://download.opensuse.org/repositories/games:tools/openSUSE_Leap_15.3/games:tools.repo
sudo zypper install mangohud
```

### Flatpak

If you are using Flatpaks, you will have to add the [Flathub repository](https://flatpak.org/setup/) for your specific distribution, and then, to install it, execute:

For flatpak:

```
flatpak install org.freedesktop.Platform.VulkanLayer.MangoHud
```

To enable MangoHud for all Steam games:

```
flatpak override --user --env=MANGOHUD=1 com.valvesoftware.Steam
```

## Normal usage

---

To enable the MangoHud overlay layer for Vulkan and OpenGL, run :

`mangohud /path/to/app`

For Lutris games, go to the System options in Lutris (make sure that advanced options are enabled) and add this to the `Command prefix` setting:

`mangohud`

For Steam games, you can add this as a launch option:

`mangohud %command%`

Or alternatively, add `MANGOHUD=1` to your shell profile (Vulkan only).

## OpenGL

OpenGL games may also need `dlsym` hooking, which is now enabled by default. Set the `MANGOHUD_DLSYM` env to `0` to disable like `MANGOHUD_DLSYM=0 %command%` for Steam.

Some Linux native OpenGL games overrides LD_PRELOAD and stops MangoHud from working. You can sometimes fix this by editing LD_PRELOAD in the start script
`LD_PRELOAD=/path/to/mangohud/lib/`

## gamescope

To enable mangohud with gamescope you need to install mangoapp.
`gamescope --mangoapp -- %command%`

Using normal mangohud with gamescope is not supported.

## Hud configuration

MangoHud comes with a config file which can be used to set configuration options globally or per application. Usually it is installed as `/usr/share/doc/mangohud/MangoHud.conf.example` or [get a copy from here](https://raw.githubusercontent.com/flightlessmango/MangoHud/master/data/MangoHud.conf).

The priorities of different config files are:

1. `/path/to/application/dir/MangoHud.conf`
2. Per-application configuration in ~/.config/MangoHud:
    1. `~/.config/MangoHud/<application_name>.conf` for native applications, where `<application_name>` is the case sensitive name of the executable
    2. `~/.config/MangoHud/wine-<application_name>.conf` for wine/proton apps, where `<application_name>` is the case sensitive name of the executable without the `.exe` ending
3. `~/.config/MangoHud/MangoHud.conf`

Example: For Overwatch, this would be `wine-Overwatch.conf` (even though the executable you run from Lutris is `Battle.net.exe`, the actual game executable name is `Overwatch.exe`).

If you start the game from the terminal with MangoHud enabled (for example by starting Lutris from the terminal), MangoHud will print the config file names it is looking for.

You can find an example config in /usr/share/doc/mangohud

[GOverlay](https://github.com/benjamimgois/goverlay) is a GUI application that can be used to manage the config

---

### Environment Variables

You can also customize the hud by using the `MANGOHUD_CONFIG` environment variable while separating different options with a comma. This takes priority over any config file.

You can also specify configuration file with `MANGOHUD_CONFIGFILE=/path/to/config` for applications whose names are hard to guess (java, python etc).

You can also specify presets file with `MANGOHUD_PRESETSFILE=/path/to/config`. This is especially useful when running mangohud in a sandbox such as flatpak.

You can also specify custom hud libraries for OpenGL using `MANGOHUD_OPENGL_LIBS=/path/to/libMangoHud_opengl.so`. This is useful for testing MangoHud without modifying the installation on your system.

A partial list of parameters are below. See the config file for a complete list.
Parameters that are enabled by default have to be explicitly disabled. These (currently) are `fps`, `frame_timing`, `cpu_stats` (cpu load), `gpu_stats` (gpu load), and each can be disabled by setting the corresponding variable to 0 (e.g., fps=0).

| Variable                           | Description                                                                           |
|------------------------------------|---------------------------------------------------------------------------------------|
| `af`                               | Anisotropic filtering level. Improves sharpness of textures viewed at an angle `0`-`16` |
| `alpha`                            | Set the opacity of all text and frametime graph `0.0`-`1.0`                           |
| `arch`                             | Show if the application is 32- or 64-bit                                              |
| `autostart_log=`                   | Starts the log after X seconds from mangohud init                                     |
| `background_alpha`                 | Set the opacity of the background `0.0`-`1.0`                                         |
| `battery_color`                    | Change the battery text color                                                         |
| `battery_icon`                     | Display battery icon instead of percent                                               |
| `battery_watt`                     | Display wattage for the battery option                                                |
| `battery_time`                     | Display remaining time for battery option                                             |
| `battery`                          | Display current battery percent and energy consumption                                |
| `benchmark_percentiles`            | Configure which framerate percentiles are shown in the logging summary. Default is `97,AVG,1,0.1` |
| `bicubic`                          | Force bicubic filtering                                                               |
| `blacklist`                        | Add a program to the blacklist. e.g `blacklist=vkcube,WatchDogs2.exe`                 |
| `cellpadding_y`                    | Set the vertical cellpadding, default is `-0.085` |
| `control=`                         | Sets up a unix socket with a specific name that can be connected to with mangohud-control.<br>I.e. `control=mangohud` or `control=mangohud-%p` (`%p` will be replaced by process id)    |
| `core_load_change`                 | Change the colors of cpu core loads, uses the same data from `cpu_load_value` and `cpu_load_change` |
| `core_load`                        | Display load & frequency per core                                                     |
| `core_type`                        | Display CPU core type per core. For Intel, it shows which cores are performance and efficient cores, for ARM it shows core codenames like A52, A53, A76, etc...                                                     |
| `core_bars`                        | Change the display of `core_load` from numbers to vertical bars                       |
| `cpu_load_change`                  | Change the color of the CPU load depending on load                                    |
| `cpu_load_color`                   | Set the colors for the gpu load change low, medium and high. e.g `cpu_load_color=0000FF,00FFFF,FF00FF` |
| `cpu_load_value`                   | Set the values for medium and high load e.g `cpu_load_value=50,90`                    |
| `cpu_mhz`                          | Show the CPUs current MHz                                                             |
| `cpu_power`<br>`gpu_power`         | Display CPU/GPU draw in watts                                                         |
| `cpu_temp`<br>`gpu_temp`<br>`gpu_junction_temp`<br>`gpu_mem_temp`           | Display current CPU/GPU temperature                                                  |
| `cpu_custom_temp_sensor`           | Use custom hwmon sensor for cpu temperature. e.g `cpu_custom_temp_sensor=cpuss0_2,temp3_input`.|
| `cpu_text`<br>`gpu_text`           | Override CPU and GPU text. `gpu_text` is a list in case of multiple GPUs              |
| `cpu_efficiency`                   | Display CPU efficiency in frames per joule                                            |
| `custom_text_center`               | Display a custom text centered useful for a header e.g `custom_text_center=FlightLessMango Benchmarks` |
| `custom_text`                      | Display a custom text e.g `custom_text=Fsync enabled`                                 |
| `debug`                            | Shows the graph of gamescope app frametimes and latency (only on gamescope obviously) |
| `device_battery_icon`              | Display wirless device battery icon.                                                  |
| `device_battery`                   | Display wireless device battery percent. Currently supported arguments `gamepad` and `mouse` e.g `device_battery=gamepad,mouse` |
| `display_server`                   | Display the current display session (e.g. X11 or wayland)                             |
| `dynamic_frame_timing`             | This changes frame_timing y-axis to correspond with the current maximum and minimum frametime instead of being a static 0-50 |
| `engine_short_names`               | Display a short version of the used engine (e.g. `OGL` instead of `OpenGL`)           |
| `engine_version`                   | Display OpenGL or vulkan and vulkan-based render engine's version                     |
| `exec`                             | Display output of bash command in next column, e.g. `custom_text=/home` , `exec=df -h /home \| tail -n 1`. Only works with `legacy_layout=0` |
| `exec_name`                        | Display current exec name                                                             |
| `fan`                              | Shows the Steam Deck fan rpm                                                          |
| `fcat`                             | Enables frame capture analysis                                                        |
| `fcat_overlay_width=`              | Sets the width of fcat. Default is `24`                                               |
| `fcat_screen_edge=`                | Decides the edge fcat is displayed on. A value between `1` and `4`                    |
| `font_file_text`                   | Change text font. Otherwise `font_file` is used                                       |
| `font_file`                        | Change default font (set location to .TTF/.OTF file)                                  |
| `font_glyph_ranges`                | Specify extra font glyph ranges, comma separated: `korean`, `chinese`, `chinese_simplified`, `japanese`, `cyrillic`, `thai`, `vietnamese`, `latin_ext_a`, `latin_ext_b`. If you experience crashes or text is just squares, reduce font size or glyph ranges |
| `font_scale=`                      | Set global font scale. Default is `1.0`                                               |
| `font_scale_media_player`          | Change size of media player text relative to `font_size`                              |
| `font_size=`                       | Customizable font size. Default is `24`                                               |
| `font_size_secondary=`             | Customizable font size for secondary metrics. Default is `0.55 * font_size`, except if `no_small_font` is set, in which case the default value is `font_size`          |
| `font_size_text=`                  | Customizable font size for other text like media metadata. Default is `24`            |
| `fps_color_change`                 | Change the FPS text color depepending on the FPS value                                |
| `fps_color=`                       | Choose the colors that the fps changes to when `fps_color_change` is enabled. Corresponds with fps_value. Default is `b22222,fdfd09,39f900`   |
| `fps_limit_method`                 | If FPS limiter should wait before or after presenting a frame. Choose `late` (default) for the lowest latency or `early` for the smoothest frametimes |
| `fps_limit`                        | Limit the apps framerate. Comma-separated list of one or more FPS values. `0` means unlimited |
| `fps_only`                         | Show FPS only. ***Not meant to be used with other display params***                   |
| `fps_sampling_period=`             | Time interval between two sampling points for gathering the FPS in milliseconds. Default is `500`   |
| `fps_value`                        | Choose the break points where `fps_color_change` changes colors between. E.g `60,144`, default is `30,60` |
| `fps_metrics`                      | Takes a list of decimal values or the value avg, e.g `avg,0.001`                      |
| `reset_fps_metrics`                | Reset fps metrics keybind, default is `Shift_R+F9`                                    |
| `fps_text`                         | Display custom text for engine name in front of FPS                                   |
| `frame_count`                      | Display frame count                                                                   |
| `frametime`                        | Display frametime next to FPS text                                                    |
| `frame_timing_detailed`            | Display frame timing in a more detailed chart                                         |
| `fsr`                              | Display the status of FSR (only works in gamescope)                                   |
| `hdr`                              | Display the status of HDR (only works in gamescope)                                   |
| `refresh_rate`                     | Display the current refresh rate (only works in gamescope)                            |
| `full`                             | Enable most of the toggleable parameters (currently excludes `histogram`)             |
| `gamemode`                         | Show if GameMode is on                                                                |
| `gpu_color`<br>`cpu_color`<br>`vram_color`<br>`ram_color`<br>`io_color`<br>`engine_color`<br>`frametime_color`<br>`background_color`<br>`text_color`<br>`media_player_color`<br>`network_color`         | Change default colors: `gpu_color=RRGGBB` |
| `gpu_core_clock`<br>`gpu_mem_clock`| Display GPU core/memory frequency                                                     |
| `gpu_fan`                          | GPU fan in RPM, except NVIDIA where it is a percentage |
| `gpu_load_change`                  | Change the color of the GPU load depending on load                                    |
| `gpu_load_color`                   | Set the colors for the gpu load change low,medium and high. e.g `gpu_load_color=0000FF,00FFFF,FF00FF` |
| `gpu_load_value`                   | Set the values for medium and high load e.g `gpu_load_value=50,90`                    |
| `gpu_name`                         | Display GPU name from pci.ids                                                         |
| `gpu_voltage`                      | Display GPU voltage                                                                   |
| `gpu_list`                         | List GPUs to display `gpu_list=0,1`                                                   |
| `gpu_efficiency`                   | Display GPU efficiency in frames per joule                                            |
| `gpu_power_limit`                  | Display GPU power limit                                                               |
| `hide_fsr_sharpness`               | Hides the sharpness info for the `fsr` option (only available in gamescope)           |
| `histogram`                        | Change FPS graph to histogram                                                         |
| `horizontal`                       | Display Mangohud in a horizontal position                                             |
| `horizontal_separator_color`       | Set the colors for the horizontal separators (horizontal layout only)                 |
| `horizontal_stretch`               | Stretches the background to the screens width in `horizontal` mode                    |
| `hud_compact`                      | Display compact version of MangoHud                                                   |
| `hud_no_margin`                    | Remove margins around MangoHud                                                        |
| `io_read`<br> `io_write`           | Show non-cached IO read/write, in MiB/s                                               |
| `log_duration`                     | Set amount of time the logging will run for (in seconds)                              |
| `log_interval`                     | Change the default log interval in milliseconds. Default is `0`                       |
| `log_versioning`                   | Adds more headers and information such as versioning to the log. This format is not supported on flightlessmango.com (yet)    |
| `media_player_format`              | Format media player metadata. Add extra text etc. Semi-colon breaks to new line. Defaults to `{title};{artist};{album}` |
| `media_player_name`                | Force media player DBus service name without the `org.mpris.MediaPlayer2` part, like `spotify`, `vlc`, `audacious` or `cantata`. If none is set, MangoHud tries to switch between currently playing players |
| `media_player`                     | Show media player metadata                                                            |
| `no_display`                       | Hide the HUD by default                                                               |
| `no_small_font`                    | Use primary font size for smaller text like units                                     |
| `offset_x` `offset_y`              | HUD position offsets                                                                  |
| `output_file`                      | Set location and name of the log file                                                 |
| `output_folder`                    | Set location of the output files (Required for logging)                               |
| `pci_dev`                          | Select GPU device in multi-gpu setups                                                 |
| `permit_upload`                    | Allow uploading of logs to Flightlessmango.com                                        |
| `picmip`                           | Mip-map LoD bias. Negative values will increase texture sharpness (and aliasing). Positive values will increase texture blurriness `-16`-`16` |
| `position=`                        | Location of the HUD: `top-left` (default), `top-right`, `middle-left`, `middle-right`, `bottom-left`, `bottom-right`, `top-center`, `bottom-center` |
| `preset=`                          | Comma separated list of one or more presets. Default is `-1,0,1,2,3,4`. Available presets:<br>`0` (No Hud)<br> `1` (FPS Only)<br> `2` (Horizontal)<br> `3` (Extended)<br> `4` (Detailed)<br>User defined presets can be created by using a [presets.conf](data/presets.conf) file in `~/.config/MangoHud/`.                      |
| `procmem`<br>`procmem_shared`, `procmem_virt`| Displays process' memory usage: resident, shared and/or virtual. `procmem` (resident) also toggles others off if disabled |
| `proc_vram`                        | Display process' VRAM usage                                                           |
| `ram`<br>`vram`                    | Display system RAM/VRAM usage                                                         |
| `ram_temp`                         | Display RAM temperature (only supports DDR5 with `spd5118` driver)                    |
| `read_cfg`                         | Add to MANGOHUD_CONFIG as first parameter to also load config file. Otherwise only `MANGOHUD_CONFIG` parameters are used |
| `reload_cfg=`                      | Change keybind for reloading the config. Default = `Shift_L+F4`                       |
| `resolution`                       | Display the current resolution                                                        |
| `retro`                            | Disable linear texture filtering. Makes textures look blocky                          |
| `round_corners`                    | Change the amount of roundness of the corners have e.g `round_corners=10.0`           |
| `show_fps_limit`                   | Display the current FPS limit                                                         |
| `swap`                             | Display swap space usage next to system RAM usage                                     |
| `table_columns`                    | Set the number of table columns for ImGui, defaults to 3                              |
| `temp_fahrenheit`                  | Show temperature in Fahrenheit                                                        |
| `text_outline`                     | Draw an outline around text for better readability. Enabled by default.               |
| `text_outline_color=`              | Set the color of `text_outline`. Default = `000000`                                   |
| `text_outline_thickness=`          | Set the thickness of `text_outline`. Default = `1.5`                                  |
| `throttling_status`                | Show if GPU is throttling based on Power, current, temp or "other" (Only shows if throttling is currently happening). Currently disabled by default for Nvidia as it causes lag on 3000 series |
| `throttling_status_graph`          | Same as `throttling_status` but displays throttling in the frametime graph and only power and temp throttling |
| `time`<br>`time_format=%T`         | Display local time. See [std::put_time](https://en.cppreference.com/w/cpp/io/manip/put_time) for formatting help. NOTE: Sometimes apps may set `TZ` (timezone) environment variable to UTC/GMT |
| `time_no_label`                    | Remove the label before time                                                          |
| `toggle_fps_limit`                 | Cycle between FPS limits (needs at least two values set with `fps_limit`). Defaults to `Shift_L+F1`                                    |
| `toggle_preset`                    | Cycle between Presets. Defaults to `Shift_R+F10`                                      |
| `toggle_hud=`<br>`toggle_logging=` | Modifiable toggle hotkeys. Default are `Shift_R+F12` and `Shift_L+F2`, respectively   |
| `toggle_hud_position`              | Toggle MangoHud position. Default is `R_Shift+F11`                                     |
| `trilinear`                        | Force trilinear filtering                                                             |
| `upload_log`                       | Change keybind for uploading log                                                      |
| `upload_logs`                      | Enables automatic uploads of logs to flightlessmango.com                              |
| `version`                          | Show current MangoHud version                                                         |
| `vkbasalt`                         | Show if vkBasalt is on                                                                |
| `vsync`<br> `gl_vsync`             | Set Vsync for OpenGL or Vulkan                                                        |
| `vulkan_present_mode=<name>`       | Override Vulkan [present mode](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkPresentModeKHR.html) using specified mode name (takes precedence over `vsync=`) |
| `vulkan_driver`                    | Display used Vulkan driver (radv/amdgpu-pro/amdvlk)                                   |
| `width=`<br>`height=`              | Customizable HUD dimensions (in pixels)                                              |
| `wine_color`                       | Change color of the wine/proton text                                                  |
| `wine`                             | Show current Wine or Proton version in use                                            |
| `winesync`                         | Show wine sync method in use                                                          |
| `present_mode`                     | Shows current vulkan [present mode](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkPresentModeKHR.html) or vsync status in opengl  |
| `network`                          | Show network interfaces tx and rx kb/s. You can specify interface with `network=eth0` |
| `fex_stats`                        | Show FEX-Emu statistics. Default = `status+apptype+hotthreads+jitload+sigbus+smc+softfloat` |
| `ftrace`                           | Display information about trace events reported through ftrace                        |
| `flip_efficiency`                  | Flips CPU and GPU efficiency to joules per frame                                      |

Example: `MANGOHUD_CONFIG=cpu_temp,gpu_temp,position=top-right,height=500,font_size=32`
Because comma is also used as option delimiter and needs to be escaped for values with a backslash, you can use `+` like `MANGOHUD_CONFIG=fps_limit=60+30+0` instead.

*Note: Width and Height are set automatically based on the font_size, but can be overridden.*

*Note: RAPL is currently used for Intel and AMD Zen CPUs to show power draw with `cpu_power` which may be unreadable for non-root users due to [vulnerability](https://platypusattack.com/). The corresponding `energy_uj` file has to be readable by corresponding user, e.g. by running `chmod o+r /sys/class/powercap/intel-rapl\:0/energy_uj` as root, else the power shown will be **0 W**, though having the file readable may potentially be a security vulnerability persisting until system reboots.*

*Note: The [zenpower3](https://git.exozy.me/a/zenpower3) or [zenergy](https://github.com/boukehaarsma23/zenergy) kernel driver must be installed to show the power draw of Ryzen CPUs.*

## Vsync

### OpenGL Vsync

- `-1` = Adaptive sync
- `0`  = Off
- `1`  = On
- `n`  = Sync to refresh rate / n.

### Vulkan Vsync

- `0` = Adaptive VSync (FIFO_RELAXED_KHR)
- `1` = Off (IMMEDIATE_KHR)
- `2` = Mailbox (VSync with uncapped FPS) (MAILBOX_KHR)
- `3` = On (FIFO_KHR)

Not all vulkan vsync options may be supported on your device, you can check what your device supports here [vulkan.gpuinfo.org](https://vulkan.gpuinfo.org/listsurfacepresentmodes.php?platform=linux)

## Keybindings

- `Shift_L+F2` : Toggle Logging
- `Shift_L+F4` : Reload Config
- `Shift_R+F12` : Toggle Hud
- `Shift_R+F9` : Reset FPS metrics

## Workarounds

Options starting with "gl_*" are for OpenGL.

- `gl_size_query = viewport` : Specify what to use for getting display size. Options are "viewport", "scissorbox" or disabled. Defaults to using glXQueryDrawable.
- `gl_bind_framebuffer = 0..N` : (Re)bind given framebuffer before MangoHud gets drawn. Helps with Crusader Kings III.
- `gl_dont_flip = 1` : Don't swap origin if using GL_UPPER_LEFT. Helps with Ryujinx.

## FPS logging

You must set a valid path for `output_folder` in your configuration to store logs in.

When you toggle logging (default keybind is `Shift_L+F2`), a file is created with the game name plus a date & timestamp in your `output_folder`.

Log files can be visualized with two different tools: online and locally.

### Online visualization: FlightlessMango.com
Log files can be (batch) uploaded to [FlightlessMango.com](https://flightlessmango.com/games/user_benchmarks), which will then take care of creating a frametime graph and a summary with 1% min / average framerate / 97th percentile in a table form and a horizontal bar chart form.

Notes:
- Uploaded benchmarks are public: you can share them with anyone by simply giving them the link.
- Benchmark filenames are used as legend in the produced tables and graphs, they can be renamed after the upload.

![Gif illustrating the log uploading process](assets/log_upload_example.gif)

### Local visualization: `mangoplot`
`mangoplot` is a plotting script that is shipped with `MangoHud`: on a given folder, it takes each log file, makes a 1D heatmap of its framerates, then stacks the heats maps vertically to form a 2D graph for easy visual comparison between benchmarks.

Example output:

![Overwatch 2 windows 11 vs linux](assets/Overwatch2-w11-vs-linux.svg)

<sub><sup>Overwatch 2, 5950X + 5700XT, low graphics preset, FHD, 50% render scale</sup></sub>

## Metrics support by GPU vendor/driver
<table>
	<tr>
		<th></th>
		<th>Nvidia</th>
		<th>AMD</th>
		<th colspan="2">Intel Discrete</th>
		<th>Intel Integrated</th>
		<th>Panfrost/Panthor driver</th>
	</tr>
	<tr>
		<th></th>
		<th></th>
		<th></th>
		<th>i915</th>
		<th>xe</th>
		<th>i915/xe</th>
		<th></th>
	</tr>
	<tr>
		<td>Usage%</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🟢</td>
	</tr>
	<tr>
		<td>Temperature</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🔴</td>
		<td>🟢</td>
	</tr>
	<tr>
		<td>Junction Temperature</td>
		<td>🔴</td>
		<td>🟢</td>
		<td>🔴</td>
		<td>🔴</td>
		<td>🔴</td>
		<td>🔴</td>
	</tr>
	<tr>
		<td>Memory Temperature</td>
		<td>🔴</td>
		<td>🟢</td>
		<td>🔴</td>
		<td>🟢</td>
		<td>🔴</td>
		<td>🔴</td>
	</tr>
	<tr>
		<td>Process VRAM</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🟢</td>
	</tr>
	<tr>
		<td>System VRAM</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🔴</td>
		<td>🔴</td>
		<td>🔴</td>
		<td>🔴</td>
	</tr>
	<tr>
		<td>Total VRAM</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🔴</td>
		<td>🔴</td>
		<td>🔴</td>
		<td>🔴</td>
	</tr>
	<tr>
		<td>Memory Clock</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🔴</td>
		<td>🔴</td>
		<td>🔴</td>
		<td>🔴</td>
	</tr>
	<tr>
		<td>Core Clock</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🟢</td>
	</tr>
	<tr>
		<td>Power Usage</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🔴</td>
		<td>🔴</td>
	</tr>
	<tr>
		<td>Throttling Status</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🔴</td>
	</tr>
	<tr>
		<td>Fan Speed</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🔴</td>
		<td>🔴</td>
	</tr>
	<tr>
		<td>Voltage</td>
		<td>🔴</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🟢</td>
		<td>🔴</td>
		<td>🔴</td>
	</tr>
</table>

#### Intel notes
- GPU temperature for `i915` requires **linux 6.13+**
- Fan speed for `i915` requires **linux 6.12+**
- GPU temperature and vram temperature for `xe` requires **linux 6.15+** 
- Fan speed for `xe` requires **linux 6.16+**
- GPU usage and memory usage shows usage of current process, not total system usage (it's an issue on intel's side)
  - https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/14153
  - https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/4861
- Integrated Intel GPUs are **limited** due to lack of hwmon interface (it's an issue on intel's side, [i915 source](https://github.com/torvalds/linux/blob/5fc31936081919a8572a3d644f3fbb258038f337/drivers/gpu/drm/i915/i915_hwmon.c#L914-L916), [xe source](https://github.com/torvalds/linux/blob/5fc31936081919a8572a3d644f3fbb258038f337/drivers/gpu/drm/xe/xe_hwmon.c#L824-L826))

#### Panfrost and Panthor notes
- GPU usage requires `echo N | sudo tee /sys/class/drm/renderD*/device/profiling`
  - Where N is a number, 1 for panfrost and 3 for panthor.


================================================
FILE: bin/gen_enum_to_str.py
================================================
# Copyright © 2017 Intel Corporation

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:

# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

"""Create enum to string functions for vulkan using vk.xml."""

import argparse
import functools
import os
import re
import textwrap
import xml.etree.ElementTree as et

from mako.template import Template
from vk_extensions import Extension, filter_api, get_all_required

COPYRIGHT = textwrap.dedent(u"""\
    * Copyright © 2017 Intel Corporation
    *
    * Permission is hereby granted, free of charge, to any person obtaining a copy
    * of this software and associated documentation files (the "Software"), to deal
    * in the Software without restriction, including without limitation the rights
    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    * copies of the Software, and to permit persons to whom the Software is
    * furnished to do so, subject to the following conditions:
    *
    * The above copyright notice and this permission notice shall be included in
    * all copies or substantial portions of the Software.
    *
    * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    * SOFTWARE.""")

C_TEMPLATE = Template(textwrap.dedent(u"""\
    /* Autogenerated file -- do not edit
     * generated by ${file}
     *
     ${copyright}
     */

    #include <string.h>
    #include <vulkan/vulkan_core.h>
    #include <vulkan/vk_layer.h>
    #include "../src/mesa/util/macros.h"
    #include "vk_enum_to_str.h"

    % for enum in enums:

      % if enum.guard:
#ifdef ${enum.guard}
      % endif
    const char *
    vk_${enum.name[2:]}_to_str(${enum.name} input)
    {
        switch((int64_t)input) {
    % for v in sorted(enum.values.keys()):
        case ${v}:
            return "${enum.values[v]}";
    % endfor
        case ${enum.max_enum_name}: return "${enum.max_enum_name}";
        default:
            return "Unknown ${enum.name} value.";
        }
    }

      % if enum.guard:
#endif
      % endif
    %endfor

    % for enum in bitmasks:

      % if enum.guard:
#ifdef ${enum.guard}
      % endif
    const char *
    vk_${enum.name[2:]}_to_str(${enum.name} input)
    {
        switch((int64_t)input) {
    % for v in sorted(enum.values.keys()):
        case ${v}:
            return "${enum.values[v]}";
    % endfor
        default:
            return "Unknown ${enum.name} value.";
        }
    }

      % if enum.guard:
#endif
      % endif
    %endfor

    size_t vk_structure_type_size(const struct VkBaseInStructure *item)
    {
        switch((int)item->sType) {
    % for struct in structs:
        % if struct.extension is not None and struct.extension.define is not None:
    #ifdef ${struct.extension.define}
        case ${struct.stype}: return sizeof(${struct.name});
    #endif
        % else:
        case ${struct.stype}: return sizeof(${struct.name});
        % endif
    %endfor
        case VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO: return sizeof(VkLayerInstanceCreateInfo);
        case VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO: return sizeof(VkLayerDeviceCreateInfo);
        default:
            UNREACHABLE("Undefined struct type.");
        }
    }

    const char *
    vk_ObjectType_to_ObjectName(VkObjectType type)
    {
        switch((int)type) {
    % for object_type in sorted(object_types[0].enum_to_name.keys()):
        case ${object_type}:
            return "${object_types[0].enum_to_name[object_type]}";
    % endfor
        default:
            return "Unknown VkObjectType value.";
        }
    }
    """))

H_TEMPLATE = Template(textwrap.dedent(u"""\
    /* Autogenerated file -- do not edit
     * generated by ${file}
     *
     ${copyright}
     */

    #ifndef MESA_VK_ENUM_TO_STR_H
    #define MESA_VK_ENUM_TO_STR_H

    #include <vulkan/vulkan.h>
    #ifdef __cplusplus
    extern "C" {
    #endif

    % for enum in enums:
      % if enum.guard:
#ifdef ${enum.guard}
      % endif
    const char * vk_${enum.name[2:]}_to_str(${enum.name} input);
      % if enum.guard:
#endif
      % endif
    % endfor

    % for enum in bitmasks:
      % if enum.guard:
#ifdef ${enum.guard}
      % endif
    const char * vk_${enum.name[2:]}_to_str(${enum.name} input);
      % if enum.guard:
#endif
      % endif
    % endfor

    size_t vk_structure_type_size(const struct VkBaseInStructure *item);

    const char * vk_ObjectType_to_ObjectName(VkObjectType type);

    #ifdef __cplusplus
    } /* extern "C" */
    #endif

    #endif
    """))


H_DEFINE_TEMPLATE = Template(textwrap.dedent(u"""\
    /* Autogenerated file -- do not edit
     * generated by ${file}
     *
     ${copyright}
     */

    #ifndef MESA_VK_ENUM_DEFINES_H
    #define MESA_VK_ENUM_DEFINES_H

    #include <vulkan/vulkan_core.h>
    #ifdef __cplusplus
    extern "C" {
    #endif

    % for ext in extensions:
    #define _${ext.name}_number (${ext.number})
    % endfor

    % for enum in bitmasks:
      % if enum.bitwidth > 32:
        <% continue %>
      % endif
      % if enum.guard:
#ifdef ${enum.guard}
      % endif
    #define ${enum.all_bits_name()} ${hex(enum.all_bits_value())}u
      % if enum.guard:
#endif
      % endif
    % endfor

    % for enum in bitmasks:
      % if enum.bitwidth < 64:
        <% continue %>
      % endif
    /* Redefine bitmask values of ${enum.name} */
      % if enum.guard:
#ifdef ${enum.guard}
      % endif
      % for n, v in enum.name_to_value.items():
    #define ${n} (${hex(v)}ULL)
      % endfor
      % if enum.guard:
#endif
      % endif
    % endfor

    static inline VkFormatFeatureFlags
    vk_format_features2_to_features(VkFormatFeatureFlags2 features2)
    {
       return features2 & VK_ALL_FORMAT_FEATURE_FLAG_BITS;
    }

    #ifdef __cplusplus
    } /* extern "C" */
    #endif

    #endif
    """))


class NamedFactory(object):
    """Factory for creating enums."""

    def __init__(self, type_):
        self.registry = {}
        self.type = type_

    def __call__(self, name, **kwargs):
        try:
            return self.registry[name]
        except KeyError:
            n = self.registry[name] = self.type(name, **kwargs)
        return n

    def get(self, name):
        return self.registry.get(name)


class VkExtension(object):
    """Simple struct-like class representing extensions"""

    def __init__(self, name, number=None, define=None):
        self.name = name
        self.number = number
        self.define = define


def CamelCase_to_SHOUT_CASE(s):
   return (s[:1] + re.sub(r'(?<![A-Z])([A-Z])', r'_\1', s[1:])).upper()

def compute_max_enum_name(s):
    if s == "VkSwapchainImageUsageFlagBitsANDROID":
        return "VK_SWAPCHAIN_IMAGE_USAGE_FLAG_BITS_MAX_ENUM"
    if s == "VkTensorTilingARM":
        return "VK_TENSOR_TILING_MAX_ENUM_ARM"
    max_enum_name = CamelCase_to_SHOUT_CASE(s)
    last_prefix = max_enum_name.rsplit('_', 1)[-1]
    # Those special prefixes need to be always at the end
    if last_prefix in ['AMD', 'AMDX', 'EXT', 'INTEL', 'KHR', 'NV', 'LUNARG', 'QCOM', 'MSFT', 'ARM'] :
        max_enum_name = "_".join(max_enum_name.split('_')[:-1])
        max_enum_name = max_enum_name + "_MAX_ENUM_" + last_prefix
    else:
        max_enum_name = max_enum_name + "_MAX_ENUM"

    return max_enum_name

class VkEnum(object):
    """Simple struct-like class representing a single Vulkan Enum."""

    def __init__(self, name, bitwidth=32, values=None):
        self.name = name
        self.max_enum_name = compute_max_enum_name(name)
        self.bitwidth = bitwidth
        self.extension = None
        # Maps numbers to names
        self.values = values or dict()
        self.name_to_value = dict()
        self.guard = None
        self.name_to_alias_list = {}

    def all_bits_name(self):
        assert self.name.startswith('Vk')
        assert re.search(r'FlagBits[A-Z]*$', self.name)

        return 'VK_ALL_' + CamelCase_to_SHOUT_CASE(self.name[2:])

    def all_bits_value(self):
        return functools.reduce(lambda a,b: a | b, self.values.keys(), 0)

    def add_value(self, name, value=None,
                  extnum=None, offset=None, alias=None,
                  error=False):
        if alias is not None:
            assert value is None and offset is None
            if alias not in self.name_to_value:
                # We don't have this alias yet.  Just record the alias and
                # we'll deal with it later.
                alias_list = self.name_to_alias_list.setdefault(alias, [])
                alias_list.append(name);
                return

            # Use the value from the alias
            value = self.name_to_value[alias]

        assert value is not None or extnum is not None
        if value is None:
            value = 1000000000 + (extnum - 1) * 1000 + offset
            if error:
                value = -value

        self.name_to_value[name] = value
        if value not in self.values:
            self.values[value] = name
        elif len(self.values[value]) > len(name):
            self.values[value] = name

        # Now that the value has been fully added, resolve aliases, if any.
        if name in self.name_to_alias_list:
            for alias in self.name_to_alias_list[name]:
                self.add_value(alias, value)
            del self.name_to_alias_list[name]

    def add_value_from_xml(self, elem, extension=None):
        self.extension = extension
        if 'value' in elem.attrib:
            self.add_value(elem.attrib['name'],
                           value=int(elem.attrib['value'], base=0))
        elif 'bitpos' in elem.attrib:
            self.add_value(elem.attrib['name'],
                           value=(1 << int(elem.attrib['bitpos'], base=0)))
        elif 'alias' in elem.attrib:
            self.add_value(elem.attrib['name'], alias=elem.attrib['alias'])
        else:
            error = 'dir' in elem.attrib and elem.attrib['dir'] == '-'
            if 'extnumber' in elem.attrib:
                extnum = int(elem.attrib['extnumber'])
            else:
                extnum = extension.number
            self.add_value(elem.attrib['name'],
                           extnum=extnum,
                           offset=int(elem.attrib['offset']),
                           error=error)

    def set_guard(self, g):
        self.guard = g


class VkChainStruct(object):
    """Simple struct-like class representing a single Vulkan struct identified with a VkStructureType"""
    def __init__(self, name, stype):
        self.name = name
        self.stype = stype
        self.extension = None


def struct_get_stype(xml_node):
    for member in xml_node.findall('./member'):
        name = member.findall('./name')
        if len(name) > 0 and name[0].text == "sType":
            return member.get('values')
    return None

class VkObjectType(object):
    """Simple struct-like class representing a single Vulkan object type"""
    def __init__(self, name):
        self.name = name
        self.enum_to_name = dict()


def parse_xml(enum_factory, ext_factory, struct_factory, bitmask_factory,
              obj_type_factory, filename, beta):
    """Parse the XML file. Accumulate results into the factories.

    This parser is a memory efficient iterative XML parser that returns a list
    of VkEnum objects.
    """

    xml = et.parse(filename)
    api = 'vulkan'

    required_types = get_all_required(xml, 'type', api, beta)

    for enum_type in xml.findall('./enums[@type="enum"]'):
        if not filter_api(enum_type, api):
            continue

        type_name = enum_type.attrib['name']
        if not type_name in required_types:
            continue

        enum = enum_factory(type_name)
        for value in enum_type.findall('./enum'):
            if filter_api(value, api):
                enum.add_value_from_xml(value)

    # For bitmask we only add the Enum selected for convenience.
    for enum_type in xml.findall('./enums[@type="bitmask"]'):
        if not filter_api(enum_type, api):
            continue

        type_name = enum_type.attrib['name']
        if not type_name in required_types:
            continue

        bitwidth = int(enum_type.attrib.get('bitwidth', 32))
        enum = bitmask_factory(type_name, bitwidth=bitwidth)
        for value in enum_type.findall('./enum'):
            if filter_api(value, api):
                enum.add_value_from_xml(value)

    for feature in xml.findall('./feature'):
        if not api in feature.attrib['api'].split(','):
            continue

        for value in feature.findall('./require/enum[@extends]'):
            extends = value.attrib['extends']
            enum = enum_factory.get(extends)
            if enum is not None:
                enum.add_value_from_xml(value)
            enum = bitmask_factory.get(extends)
            if enum is not None:
                enum.add_value_from_xml(value)

    for struct_type in xml.findall('./types/type[@category="struct"]'):
        if not filter_api(struct_type, api):
            continue

        name = struct_type.attrib['name']
        if name not in required_types:
            continue

        stype = struct_get_stype(struct_type)
        if stype is not None:
            struct_factory(name, stype=stype)

    platform_define = {}
    for platform in xml.findall('./platforms/platform'):
        name = platform.attrib['name']
        define = platform.attrib['protect']
        platform_define[name] = define

    for ext_elem in xml.findall('./extensions/extension'):
        ext = Extension.from_xml(ext_elem)
        if api not in ext.supported:
            continue

        define = platform_define.get(ext.platform, None)
        extension = ext_factory(ext.name, number=ext.number, define=define)

        for req_elem in ext_elem.findall('./require'):
            if not filter_api(req_elem, api):
                continue

            for value in req_elem.findall('./enum[@extends]'):
                extends = value.attrib['extends']
                enum = enum_factory.get(extends)
                if enum is not None:
                    enum.add_value_from_xml(value, extension)
                enum = bitmask_factory.get(extends)
                if enum is not None:
                    enum.add_value_from_xml(value, extension)

            for t in req_elem.findall('./type'):
                struct = struct_factory.get(t.attrib['name'])
                if struct is not None:
                    struct.extension = extension

        if define:
            for value in ext_elem.findall('./require/type[@name]'):
                enum = enum_factory.get(value.attrib['name'])
                if enum is not None:
                    enum.set_guard(define)
                enum = bitmask_factory.get(value.attrib['name'])
                if enum is not None:
                    enum.set_guard(define)

    obj_type_enum = enum_factory.get("VkObjectType")
    obj_types = obj_type_factory("VkObjectType")
    for object_type in xml.findall('./types/type[@category="handle"]'):
        for object_name in object_type.findall('./name'):
            # Convert to int to avoid undefined enums
            enum = object_type.attrib['objtypeenum']

            # Annoyingly, object types are hard to filter by API so just
            # look for whether or not we can find the enum name in the
            # VkObjectType enum.
            if enum not in obj_type_enum.name_to_value:
                continue

            enum_val = obj_type_enum.name_to_value[enum]
            obj_types.enum_to_name[enum_val] = object_name.text


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('--beta', required=True, help='Enable beta extensions.')
    parser.add_argument('--xml', required=True,
                        help='Vulkan API XML files',
                        action='append',
                        dest='xml_files')
    parser.add_argument('--out-c',
                        help='Output C file',
                        required=True)
    parser.add_argument('--out-h',
                        help='Output H file',
                        required=True)
    parser.add_argument('--out-d',
                        help='Output defines H file',
                        required=True)

    args = parser.parse_args()

    enum_factory = NamedFactory(VkEnum)
    ext_factory = NamedFactory(VkExtension)
    struct_factory = NamedFactory(VkChainStruct)
    obj_type_factory = NamedFactory(VkObjectType)
    bitmask_factory = NamedFactory(VkEnum)

    for filename in args.xml_files:
        parse_xml(enum_factory, ext_factory, struct_factory, bitmask_factory,
                  obj_type_factory, filename, args.beta)
    enums = sorted(enum_factory.registry.values(), key=lambda e: e.name)
    extensions = sorted(ext_factory.registry.values(), key=lambda e: e.name)
    structs = sorted(struct_factory.registry.values(), key=lambda e: e.name)
    bitmasks = sorted(bitmask_factory.registry.values(), key=lambda e: e.name)
    object_types = sorted(obj_type_factory.registry.values(), key=lambda e: e.name)

    for template, file_ in [(C_TEMPLATE, args.out_c),
                            (H_TEMPLATE, args.out_h),
                            (H_DEFINE_TEMPLATE, args.out_d)]:
        with open(file_, 'w', encoding='utf-8') as f:
            f.write(template.render(
                file=os.path.basename(__file__),
                enums=enums,
                extensions=extensions,
                structs=structs,
                bitmasks=bitmasks,
                object_types=object_types,
                copyright=COPYRIGHT))


if __name__ == '__main__':
    main()


================================================
FILE: bin/mangohud-setup.sh
================================================
#!/usr/bin/env bash
OS_RELEASE_FILES=("/etc/os-release" "/usr/lib/os-release")
XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
MANGOHUD_CONFIG_DIR="$XDG_CONFIG_HOME/MangoHud"
SU_CMD=$(command -v sudo || command -v doas || echo)

# doas requires a double dash if the command it runs will include any dashes,
# so append a double dash to the command
[[ $SU_CMD == *doas ]] && SU_CMD="$SU_CMD -- "

# Correctly identify the os-release file.
for os_release in ${OS_RELEASE_FILES[@]} ; do
    if [[ ! -e "${os_release}" ]]; then
        continue
    fi
    DISTRO=$(sed -rn 's/^ID(_LIKE)*=(.+)/\2/p' ${os_release} | sed 's/"//g')
done

mangohud_usage() {
    echo 'Accepted arguments: "install", "uninstall".'
}

mangohud_config() {
    mkdir -p "${MANGOHUD_CONFIG_DIR}"
    echo You can use the example configuration file from
    echo /usr/share/doc/mangohud/MangoHud.conf.example
    echo as a starting point by copying it to
    echo ${MANGOHUD_CONFIG_DIR}/MangoHud.conf
    echo
}

mangohud_uninstall() {
    [ "$UID" -eq 0 ] || exec $SU_CMD bash "$0" uninstall
    rm -rfv "/usr/lib/mangohud"
    rm -fv "/usr/share/vulkan/implicit_layer.d/MangoHud.x86.json"
    rm -fv "/usr/share/vulkan/implicit_layer.d/MangoHud.x86_64.json"
    rm -fv "/usr/share/vulkan/implicit_layer.d/MangoHud.json"
    rm -frv "/usr/share/doc/mangohud"
    rm -fv "/usr/share/man/man1/mangohud.1"
    rm -fv "/usr/bin/mangohud"
    rm -fv "/usr/bin/mangoplot"
    rm -fv "/usr/bin/mangohud.x86"
}

mangohud_install() {
    rm -rf "$HOME/.local/share/MangoHud/"
    rm -f "$HOME/.local/share/vulkan/implicit_layer.d/"{mangohud32.json,mangohud64.json}

    [ "$UID" -eq 0 ] || mangohud_config
    [ "$UID" -eq 0 ] || tar xf MangoHud-package.tar
    [ "$UID" -eq 0 ] || exec $SU_CMD bash "$0" install

    mangohud_uninstall

    DEFAULTLIB=lib32
    for i in $DISTRO; do
        case $i in
            *arch*)
            DEFAULTLIB=lib64
            ;;
        esac
    done

    echo DEFAULTLIB: $DEFAULTLIB
    /usr/bin/install -Dvm644 ./usr/lib/mangohud/lib64/libMangoHud.so /usr/lib/mangohud/lib64/libMangoHud.so
    /usr/bin/install -Dvm644 ./usr/lib/mangohud/lib32/libMangoHud.so /usr/lib/mangohud/lib32/libMangoHud.so
    /usr/bin/install -Dvm644 ./usr/lib/mangohud/lib64/libMangoHud_opengl.so /usr/lib/mangohud/lib64/libMangoHud_opengl.so
    /usr/bin/install -Dvm644 ./usr/lib/mangohud/lib32/libMangoHud_opengl.so /usr/lib/mangohud/lib32/libMangoHud_opengl.so
    /usr/bin/install -Dvm644 ./usr/lib/mangohud/lib64/libMangoHud_shim.so /usr/lib/mangohud/lib64/libMangoHud_shim.so
    /usr/bin/install -Dvm644 ./usr/lib/mangohud/lib32/libMangoHud_shim.so /usr/lib/mangohud/lib32/libMangoHud_shim.so
    /usr/bin/install -Dvm644 ./usr/share/vulkan/implicit_layer.d/MangoHud.x86_64.json /usr/share/vulkan/implicit_layer.d/MangoHud.x86_64.json
    /usr/bin/install -Dvm644 ./usr/share/vulkan/implicit_layer.d/MangoHud.x86.json /usr/share/vulkan/implicit_layer.d/MangoHud.x86.json
    /usr/bin/install -Dvm644 ./usr/share/man/man1/mangohud.1 /usr/share/man/man1/mangohud.1
    /usr/bin/install -Dvm644 ./usr/share/doc/mangohud/MangoHud.conf.example /usr/share/doc/mangohud/MangoHud.conf.example
    /usr/bin/install -vm755  ./usr/bin/mangohud /usr/bin/mangohud
    /usr/bin/install -vm755  ./usr/bin/mangoplot /usr/bin/mangoplot

    ln -sv $DEFAULTLIB /usr/lib/mangohud/lib

    # FIXME get the triplet somehow
    ln -sv lib64 /usr/lib/mangohud/x86_64
    ln -sv lib64 /usr/lib/mangohud/x86_64-linux-gnu
    ln -sv . /usr/lib/mangohud/lib64/x86_64
    ln -sv . /usr/lib/mangohud/lib64/x86_64-linux-gnu

    ln -sv lib32 /usr/lib/mangohud/i686
    ln -sv lib32 /usr/lib/mangohud/i386-linux-gnu
    ln -sv lib32 /usr/lib/mangohud/i686-linux-gnu

    mkdir -p /usr/lib/mangohud/tls
    ln -sv ../lib64 /usr/lib/mangohud/tls/x86_64
    ln -sv ../lib32 /usr/lib/mangohud/tls/i686

    # Some distros search in $prefix/x86_64-linux-gnu/tls/x86_64 etc instead
    if [ ! -e /usr/lib/mangohud/lib/i386-linux-gnu ]; then
        ln -sv ../lib32 /usr/lib/mangohud/lib/i386-linux-gnu
    fi
    if [ ! -e /usr/lib/mangohud/lib/i686-linux-gnu ]; then
        ln -sv ../lib32 /usr/lib/mangohud/lib/i686-linux-gnu
    fi
    if [ ! -e /usr/lib/mangohud/lib/x86_64-linux-gnu ]; then
        ln -sv ../lib64 /usr/lib/mangohud/lib/x86_64-linux-gnu
    fi

    # $LIB can be "lib/tls/x86_64"?
    ln -sv ../tls /usr/lib/mangohud/lib/tls

    # Let's not clean up because this can be destructive
    # rm -rf ./usr

    echo "MangoHud Installed"
}

for a in $@; do
    case $a in
        "install") mangohud_install;;
        "uninstall") mangohud_uninstall;;
        *)
            echo "Unrecognized command argument: $a"
            mangohud_usage
    esac
done

if [ -z $@ ]; then
    mangohud_usage
fi


================================================
FILE: bin/mangohud.in
================================================
#!/bin/sh

if [ "$#" -eq 0 ]; then
    programname=$(basename "$0")
    echo "ERROR: No program supplied"
    echo
    echo "Usage: $programname <program>"
    exit 1
fi


# Add exe names newline separated to the string to disable LD_PRELOAD
DISABLE_LD_PRELOAD="
cs2.sh
RiseOfTheTombRaider.sh
"

MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud_shim.so"

if [ "$1" = "--version" ]; then
    echo @version@
    exit 0
fi

if [ "$1" = "--dlsym" ]; then
    # no-op, dlsym enabled by default
    shift
fi

# grab all arguments from command_line
command_line="$*"
# flag for disable_preload
disable_preload=false

# Check if the script name or any of the executables in DISABLE_LD_PRELOAD are in the command line
for exe in $DISABLE_LD_PRELOAD; do
    if echo "$command_line" | grep -q "$exe"; then
        disable_preload=true
        break
    fi
done

if [ "$disable_preload" = true ]; then
    exec env MANGOHUD=1 "$@"
else
    # Make sure we don't append mangohud lib multiple times
    # otherwise, this could cause issues with the steam runtime
    case ":${LD_PRELOAD-}:" in
        (*:$MANGOHUD_LIB_NAME:*)
            ;;
        (*)
            # Preload using the plain filenames of the libs, the dynamic linker will
            # figure out whether the 32 or 64 bit version should be used
            LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}${MANGOHUD_LIB_NAME}"
    esac

    exec env MANGOHUD=1 LD_PRELOAD="${LD_PRELOAD}" "$@"
fi


================================================
FILE: bin/mangoplot.py
================================================
#!/usr/bin/env python

r"""
    Script to plot all the MangoHud benchmarks contained in a given folder.
"""
from pathlib import Path
import argparse
import csv

from typing import List, Union

import numpy as np

import matplotlib.pyplot as plt
from matplotlib.widgets import Cursor
from matplotlib.colors import LinearSegmentedColormap
from matplotlib.ticker import EngFormatter

plt.rcParams['font.family'] = "Lato,serif"
plt.rcParams['font.weight'] = "600"

background_color = "#1A1C1D"
legend_facecolor = "#585f63"
legend_textcolor = "#cccbc9"
text_color = "#e8e6e3"
mango_color = "#BB770A"
graphbox_linewidth = 1.5

mango_cmap = LinearSegmentedColormap.from_list("mango_heat", [background_color, mango_color])

def identity(val):
    r"""
        returns the value as-is
    """
    return val


def get_integer(val: str) -> int:
    r"""
        interprets the str 'val' as an integer and returns it
    """
    if is_integer(val):
        return int(val)
    else:
        raise ValueError("Casting a non integer value: ", val)


def is_integer(s: str) -> bool:
    r"""
        tests if 's' is an integer and returns a bool
    """
    try:
        int(s)
        return True
    except ValueError:
        return False


def get_float(val):
    r"""
        interprets the str 'val' as a float and returns it
    """
    if is_float(val):
        return float(val)
    else:
        return float("nan")


def is_float(s: str) -> bool:
    r"""
        tests if 's' is an float and returns a bool
    """
    try:
        float(s)
        return True
    except ValueError:
        return False


class Database:
    r"""
        A class that contains all the csv files within
        the folder that it is instanced with
    """
    def __init__(self,
                 data_folder_path=None,
                 csv_separator=" ",
                 filename_var_separator="|"):

        self.datafiles = []
        self.result_names_col = None
        self.result_values_col = None
        self.sim_settings_names_col = None
        self.sim_settings_values_col = None

        if data_folder_path:
            self.load_from_folder(
                data_folder_path,
                csv_separator,
                filename_var_separator)

    def load_from_folder(self,
                         data_folder_path,
                         csv_separator=" ",
                         filename_var_separator="|"):
        r"""
            Load all CSV files form the given folder
        """
        filepaths = list(Path(data_folder_path).rglob("*.csv"))

        self.datafiles = []
        N = len(filepaths)

        print(f"Loading {N} benchmark files")
        for filepath in filepaths:
            try:
                datafile = BenchmarkFile(
                    str(filepath),
                    csv_separator=csv_separator,
                    filename_var_separator=filename_var_separator)
                self.datafiles.append(datafile)
            except Exception:
                pass

        self.datafiles.sort()


class BenchmarkFile:
    r"""
        A class that represents a single CSV file, can load CSV files
        with arbitrary separators. It can return separately any column
        of the file and any mathematical combinations of its columns.
    """

    def __init__(self,
                 filepath="",
                 filename_var_separator="|",
                 csv_separator=" "):
        self.csv_separator = csv_separator
        self.filepath = Path(filepath)
        self.filename = self.filepath.name
        self.filename_var_separator = filename_var_separator
        self.variables = dict()

        self.skip_lines = None

        self.columns = []
        self.column_name_to_index = dict()

        self._is_data_loaded = False

        if not self.filepath.is_file():
            raise Exception("CSV file does not exist")

        self._read_column_names()

    def __lt__(self, other):
        stem = self.filename[:-4]  # remove the trailing ".csv"
        other_stem = other.filename[:-4]
        if stem.startswith(other_stem):
            return False
        elif stem.startswith(other_stem):
            return True
        else:
            return stem < other_stem

    def set_variable(self, name, value):
        r"""
            Saves a variable within the datafile instance
            Note: it will not be saved to disk, it's just a helper method to
                  attach variables to a given data file.
        """
        self.variables[name] = value

    def get_variable(self, name):
        r"""
            Retrieves a saved variable in the instance
        """
        return self.variables[name]

    def _read_column_names(self):
        r"""
            Read the first few lines of the benchmark file
            to look for the row taht contains the benchmark's
            column names i.e. "fps", "frametime", "cpu_load"... etc
            and save the columns names and their index

            Note: we decide that we found the right row by looking if it
                  contains "fps"
                  not the best approach, but it works TM
        """

        with open(self.filepath) as open_file:
            reader = csv.reader(open_file, delimiter=self.csv_separator)

            found_fps_column = False
            for row_number, row_content in enumerate(reader):
                if row_number > 100:
                    # did not find the row that starts with the
                    # 'fps' column up until here.  give up.
                    break

                if "fps" in row_content:
                    self.skip_lines = row_number + 1
                    found_fps_column = True

                    for col, col_name in enumerate(row_content):
                        if col_name in self.column_name_to_index:
                            raise Exception("Two columns have the same name")
                        self.column_name_to_index[col_name] = col

            if not found_fps_column:
                raise Exception("Not a benchmark file")

    def _load_data(self):
        r"""
            Load the benchmark data into memory.
        """

        def extend_columns(new_column_num):
            current_row_num = 0
            if self.columns:
                current_row_num = len(self.columns[0])
                assert (all([len(column) == current_row_num for column in self.columns]))

            current_column_num = len(self.columns)
            if new_column_num >= current_column_num:
                self.columns += [["" for j in range(current_row_num)] for i in range(new_column_num - current_column_num)]

        # no need to load data if it's already loaded
        if self._is_data_loaded:
            return

        with open(self.filepath) as open_file:
            reader = csv.reader(open_file, delimiter=self.csv_separator)
            self._is_data_loaded = True

            for row_number, row_content in enumerate(reader):
                if row_number <= self.skip_lines:
                    continue

                extend_columns(len(row_content))
                for col, val in enumerate(row_content):
                    self.columns[col].append(val)

        # Delete any eventual empty column
        if all([val == "" for val in self.columns[-1]]):
            del self.columns[-1]

    def get_column_names(self) -> List[str]:
        r"""
        Returns the list of columns names of the csv file.
        """

        return list(self.column_name_to_index.keys())

    def get(self, col: str, data_type: str = "float") \
            -> Union[List[float], List[str], List[int], List[complex]]:
        r"""
        Returns the column `col`.

        Parameters
        ----------

        col : str
            The desired column name to retrieve, or its index

        data_type : str
            "string", "integer" or "float", the type to cast
            the data to before returning it.

        Returns
        -------

        A list of `data_type` containing the column `col`

        """

        if not self._is_data_loaded:
            self._load_data()

        if len(self.columns) == 0:
            raise ValueError("Datafile empty, can't return any data")

        data_caster_dict = {
            "string": identity,
            "float": get_float,
            "integer": get_integer
        }

        if data_type not in data_caster_dict:
            raise ValueError("the given `data_type' doesn't match any "
                             "known types. Which are `string', `integer', "
                             "`float' or `complex'")

        if is_integer(col):
            # the column's index is given
            return [data_caster_dict[data_type](val) for val in self.columns[col]]

        if col in self.column_name_to_index:
            # a column name has been given
            return [data_caster_dict[data_type](val)
                    for val in self.columns[self.column_name_to_index[col]]]

        raise Exception("Column {} does not exist".format(col))


if __name__ == '__main__':
    parser = argparse.ArgumentParser(
        description='Plot all the MangoHud benchmarks contained in a given folder.')

    parser.add_argument('folder', metavar='folder', nargs=1,
                        help='path the a MangoHud benchmark folder')

    args = parser.parse_args()

    bench_folder_path = Path(args.folder[0])

    if not bench_folder_path.is_dir():
        print(f"The path '{bench_folder_path.absolute()}' "
               "does not point to an existing folder")
        exit(1)

    fps_subdivs = 1.0  # one division every fps_subdivs FPS

    y_labels = []  # bench files
    x_labels = []  # FPS subidivions

    database = Database(bench_folder_path, csv_separator=',')
    distributions = []

    if len(database.datafiles) == 0:
        print(f"The folder \n   {bench_folder_path.absolute()} \n"
               "contains no CSV file "
               "(make sure they have the .csv extension)")
        exit(1)

    for datafile in database.datafiles:
        bar_distribution = []

        # sort array to get percentiles
        fps_array = np.sort(datafile.get("fps"))

        # save percentiles
        if len(fps_array) < 10000:
            print(f"'{datafile.filename}' simulation "
                   "isn't long enough for precise statistics")
            datafile.set_variable("selected", False)
            continue

        # Save label only if this file has long enough simulation
        y_labels.append(datafile.filename[:-4])
        datafile.set_variable("selected", True)

        # Save percentiles
        datafile.set_variable("0.1%", fps_array[int(float(len(fps_array))*0.001)])
        datafile.set_variable("1%", fps_array[int(float(len(fps_array))*0.01)])
        datafile.set_variable("50%", fps_array[int(float(len(fps_array))*0.5)])

        datafile.set_variable("average fps", np.average(fps_array))

        for frame_num, fps in enumerate(fps_array):
            if fps > 1000:
                print("FPS value above 1000, omitting outlier.")
                continue
            index = int(fps/fps_subdivs)
            for i in range(len(bar_distribution), index+1):
                bar_distribution.append(0)
            bar_distribution[index] += 1
        distributions.append(bar_distribution)

    if not distributions:
        print("Nothing to plot, exiting.")
        exit(1)

    num_benchs = len(distributions)
    max_size = 0
    for distrib in distributions:
        max_size = max(max_size, len(distrib))
    for distrib in distributions:
        for i in range(len(distrib), max_size):
            distrib.append(0)

    for i in range(max_size):
        x_labels.append(str(fps_subdivs * i))

    fig, ax = plt.subplots()

    # change color of the graph box to the same color as the text
    for spine in ['left', 'right', 'bottom', 'top']:
      ax.spines[spine].set_color(text_color)
      ax.spines[spine].set_linewidth(graphbox_linewidth)

    im = ax.imshow(distributions,
                   aspect="auto",
                   extent=[0, max_size*fps_subdivs, 0, num_benchs],
                   cmap=mango_cmap)

    # draw thick line that separates each benchmark
    for i in range(len(y_labels)+1):
        ax.axhline(float(i), color=text_color, lw=graphbox_linewidth)

    i = 0
    for datafile in database.datafiles:
        if datafile.get_variable("selected"):
            kwargs = dict(ymin=(num_benchs-i-1+0.15)/num_benchs,
                          ymax=(num_benchs-i-0.15)/num_benchs,
                          lw=3)

            ax.axvline(datafile.get_variable("0.1%"),
                       color='#35260f',
                       label=("0.1%" if i == 0 else None), **kwargs)

            ax.axvline(datafile.get_variable("1%"),
                       color='#6E4503',
                       label=("1%" if i == 0 else None), **kwargs)

            ax.axvline(datafile.get_variable("50%"),
                       color='#0967BA',
                       label=("50%" if i == 0 else None), **kwargs)

            ax.axvline(datafile.get_variable("average fps"),
                       color='#003A6E',
                       label=("Average" if i == 0 else None), **kwargs)
            i += 1

    ax.tick_params(axis='y', colors=text_color)
    ax.tick_params(axis='x', colors=text_color)
    ax.set_yticks(np.arange(len(y_labels)-0.5, 0, -1), labels=y_labels)
    ax.grid(False)

    fig.set_facecolor(background_color)

    ax.ticklabel_format(axis='x', style='plain')

    formatter0 = EngFormatter(unit='FPS')
    ax.xaxis.set_major_formatter(formatter0)

    plt.tight_layout()
    plt.legend(facecolor=legend_facecolor, labelcolor=legend_textcolor)

    cursor = Cursor(ax,
                    horizOn=False,
                    color='#6c49abff',
                    linewidth=4,
                    useblit=True)

    plt.show()


================================================
FILE: bin/meson.build
================================================
# runtime dependencies for `mangoplot`: matplotlib and a GUI backed like PyQt5
install_data(
  'mangoplot.py',
  install_dir: get_option('bindir'),
  rename: 'mangoplot',
  install_mode: 'rwxr-xr-x'
)


================================================
FILE: bin/vk_dispatch_table_gen.py
================================================
COPYRIGHT = """\
/*
 * Copyright 2020 Intel Corporation
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sub license, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice (including the
 * next paragraph) shall be included in all copies or substantial portions
 * of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
"""

import argparse
import math
import os

from mako.template import Template

# Mesa-local imports must be declared in meson variable
# '{file_without_suffix}_depend_files'.
from vk_entrypoints import get_entrypoints_from_xml

# We generate a static hash table for entry point lookup
# (vkGetProcAddress). We use a linear congruential generator for our hash
# function and a power-of-two size table. The prime numbers are determined
# experimentally.

TEMPLATE_H = Template(COPYRIGHT + """\
/* This file generated from ${filename}, don't edit directly. */

#ifndef VK_DISPATCH_TABLE_H
#define VK_DISPATCH_TABLE_H

#include "vulkan/vulkan.h"

#include "vk_extensions.h"

/* Windows api conflict */
#ifdef _WIN32
#include <windows.h>
#ifdef CreateSemaphore
#undef CreateSemaphore
#endif
#ifdef CreateEvent
#undef CreateEvent
#endif
#endif

#ifdef __cplusplus
extern "C" {
#endif

#ifdef _MSC_VER
VKAPI_ATTR void VKAPI_CALL vk_entrypoint_stub(void);
#endif

<%def name="dispatch_table(entrypoints)">
% for e in entrypoints:
  % if e.alias:
    <% continue %>
  % endif
  % if e.guard is not None:
#ifdef ${e.guard}
  % endif
  % if e.aliases:
    union {
        PFN_vk${e.name} ${e.name};
      % for a in e.aliases:
        PFN_vk${a.name} ${a.name};
      % endfor
    };
  % else:
    PFN_vk${e.name} ${e.name};
  % endif
  % if e.guard is not None:
#else
    % if e.aliases:
    union {
        PFN_vkVoidFunction ${e.name};
      % for a in e.aliases:
        PFN_vkVoidFunction ${a.name};
      % endfor
    };
    % else:
    PFN_vkVoidFunction ${e.name};
    % endif
#endif
  % endif
% endfor
</%def>

<%def name="entrypoint_table(type, entrypoints)">
struct vk_${type}_entrypoint_table {
% for e in entrypoints:
  % if e.guard is not None:
#ifdef ${e.guard}
  % endif
    PFN_vk${e.name} ${e.name};
  % if e.guard is not None:
#else
    PFN_vkVoidFunction ${e.name};
# endif
  % endif
% endfor
};
</%def>

struct vk_instance_dispatch_table {
  ${dispatch_table(instance_entrypoints)}
};

struct vk_physical_device_dispatch_table {
  ${dispatch_table(physical_device_entrypoints)}
};

struct vk_device_dispatch_table {
  ${dispatch_table(device_entrypoints)}
};

struct vk_dispatch_table {
    union {
        struct {
            struct vk_instance_dispatch_table instance;
            struct vk_physical_device_dispatch_table physical_device;
            struct vk_device_dispatch_table device;
        };

        struct {
            ${dispatch_table(instance_entrypoints)}
            ${dispatch_table(physical_device_entrypoints)}
            ${dispatch_table(device_entrypoints)}
        };
    };
};

${entrypoint_table('instance', instance_entrypoints)}
${entrypoint_table('physical_device', physical_device_entrypoints)}
${entrypoint_table('device', device_entrypoints)}

<%def name="uncompacted_dispatch_table(entrypoints)">
% for e in entrypoints:
  % if e.alias:
    <% continue %>
  % endif
  % if e.guard is not None:
#ifdef ${e.guard}
  % endif
    PFN_vk${e.name} ${e.name};
  % if e.aliases:
    % for a in e.aliases:
    PFN_vk${a.name} ${a.name};
    % endfor
  % endif
  % if e.guard is not None:
#else
    PFN_vkVoidFunction ${e.name};
    % if e.aliases:
      % for a in e.aliases:
        PFN_vkVoidFunction ${a.name};
      % endfor
    % endif
#endif
  % endif
% endfor
</%def>


struct vk_instance_uncompacted_dispatch_table {
  ${uncompacted_dispatch_table(instance_entrypoints)}
};

struct vk_physical_device_uncompacted_dispatch_table {
  ${uncompacted_dispatch_table(physical_device_entrypoints)}
};

struct vk_device_uncompacted_dispatch_table {
  ${uncompacted_dispatch_table(device_entrypoints)}
};

struct vk_uncompacted_dispatch_table {
    union {
        struct {
            struct vk_instance_uncompacted_dispatch_table instance;
            struct vk_physical_device_uncompacted_dispatch_table physical_device;
            struct vk_device_uncompacted_dispatch_table device;
        };

        struct {
            ${uncompacted_dispatch_table(instance_entrypoints)}
            ${uncompacted_dispatch_table(physical_device_entrypoints)}
            ${uncompacted_dispatch_table(device_entrypoints)}
        };
    };
};

void
vk_instance_dispatch_table_load(struct vk_instance_dispatch_table *table,
                                PFN_vkGetInstanceProcAddr gpa,
                                VkInstance instance);
void
vk_physical_device_dispatch_table_load(struct vk_physical_device_dispatch_table *table,
                                       PFN_vkGetInstanceProcAddr gpa,
                                       VkInstance instance);
void
vk_device_dispatch_table_load(struct vk_device_dispatch_table *table,
                              PFN_vkGetDeviceProcAddr gpa,
                              VkDevice device);

void
vk_instance_uncompacted_dispatch_table_load(struct vk_instance_uncompacted_dispatch_table *table,
                                PFN_vkGetInstanceProcAddr gpa,
                                VkInstance instance);
void
vk_physical_device_uncompacted_dispatch_table_load(struct vk_physical_device_uncompacted_dispatch_table *table,
                                       PFN_vkGetInstanceProcAddr gpa,
                                       VkInstance instance);
void
vk_device_uncompacted_dispatch_table_load(struct vk_device_uncompacted_dispatch_table *table,
                              PFN_vkGetDeviceProcAddr gpa,
                              VkDevice device);

void vk_instance_dispatch_table_from_entrypoints(
    struct vk_instance_dispatch_table *dispatch_table,
    const struct vk_instance_entrypoint_table *entrypoint_table,
    bool overwrite);

void vk_physical_device_dispatch_table_from_entrypoints(
    struct vk_physical_device_dispatch_table *dispatch_table,
    const struct vk_physical_device_entrypoint_table *entrypoint_table,
    bool overwrite);

void vk_device_dispatch_table_from_entrypoints(
    struct vk_device_dispatch_table *dispatch_table,
    const struct vk_device_entrypoint_table *entrypoint_table,
    bool overwrite);

PFN_vkVoidFunction
vk_instance_dispatch_table_get(const struct vk_instance_dispatch_table *table,
                               const char *name);

PFN_vkVoidFunction
vk_physical_device_dispatch_table_get(const struct vk_physical_device_dispatch_table *table,
                                      const char *name);

PFN_vkVoidFunction
vk_device_dispatch_table_get(const struct vk_device_dispatch_table *table,
                             const char *name);

PFN_vkVoidFunction
vk_instance_dispatch_table_get_if_supported(
    const struct vk_instance_dispatch_table *table,
    const char *name,
    uint32_t core_version,
    const struct vk_instance_extension_table *instance_exts);

PFN_vkVoidFunction
vk_physical_device_dispatch_table_get_if_supported(
    const struct vk_physical_device_dispatch_table *table,
    const char *name,
    uint32_t core_version,
    const struct vk_instance_extension_table *instance_exts);

PFN_vkVoidFunction
vk_device_dispatch_table_get_if_supported(
    const struct vk_device_dispatch_table *table,
    const char *name,
    uint32_t core_version,
    const struct vk_instance_extension_table *instance_exts,
    const struct vk_device_extension_table *device_exts);

#ifdef __cplusplus
}
#endif

#endif /* VK_DISPATCH_TABLE_H */
""")

TEMPLATE_C = Template(COPYRIGHT + """\
/* This file generated from ${filename}, don't edit directly. */

#include "vk_dispatch_table.h"

#include "../src/mesa/util/macros.h"
#include "string.h"

<%def name="load_dispatch_table(type, VkType, ProcAddr, entrypoints)">
void
vk_${type}_dispatch_table_load(struct vk_${type}_dispatch_table *table,
                               PFN_vk${ProcAddr} gpa,
                               ${VkType} obj)
{
% if type != 'physical_device':
    table->${ProcAddr} = gpa;
% endif
% for e in entrypoints:
  % if e.alias or e.name == '${ProcAddr}':
    <% continue %>
  % endif
  % if e.guard is not None:
#ifdef ${e.guard}
  % endif
    table->${e.name} = (PFN_vk${e.name}) gpa(obj, "vk${e.name}");
  % for a in e.aliases:
    if (table->${e.name} == NULL) {
        table->${e.name} = (PFN_vk${e.name}) gpa(obj, "vk${a.name}");
    }
  % endfor
  % if e.guard is not None:
#endif
  % endif
% endfor
}
</%def>

${load_dispatch_table('instance', 'VkInstance', 'GetInstanceProcAddr',
                      instance_entrypoints)}

${load_dispatch_table('physical_device', 'VkInstance', 'GetInstanceProcAddr',
                      physical_device_entrypoints)}

${load_dispatch_table('device', 'VkDevice', 'GetDeviceProcAddr',
                      device_entrypoints)}

<%def name="load_uncompacted_dispatch_table(type, VkType, ProcAddr, entrypoints)">
void
vk_${type}_uncompacted_dispatch_table_load(struct vk_${type}_uncompacted_dispatch_table *table,
                               PFN_vk${ProcAddr} gpa,
                               ${VkType} obj)
{
% if type != 'physical_device':
    table->${ProcAddr} = gpa;
% endif
% for e in entrypoints:
  % if e.alias or e.name == '${ProcAddr}':
    <% continue %>
  % endif
  % if e.guard is not None:
#ifdef ${e.guard}
  % endif
    table->${e.name} = (PFN_vk${e.name}) gpa(obj, "vk${e.name}");
  % for a in e.aliases:
    table->${a.name} = (PFN_vk${a.name}) gpa(obj, "vk${a.name}");
    if (table->${e.name} && !table->${a.name})
       table->${a.name} = (PFN_vk${a.name}) table->${e.name};
    if (!table->${e.name})
       table->${e.name} = (PFN_vk${e.name}) table->${a.name};
  % endfor
  % if e.guard is not None:
#endif
  % endif
% endfor
}
</%def>

${load_uncompacted_dispatch_table('instance', 'VkInstance', 'GetInstanceProcAddr',
                      instance_entrypoints)}

${load_uncompacted_dispatch_table('physical_device', 'VkInstance', 'GetInstanceProcAddr',
                      physical_device_entrypoints)}

${load_uncompacted_dispatch_table('device', 'VkDevice', 'GetDeviceProcAddr',
                      device_entrypoints)}


struct string_map_entry {
   uint32_t name;
   uint32_t hash;
   uint32_t num;
};

/* We use a big string constant to avoid lots of reloctions from the entry
 * point table to lots of little strings. The entries in the entry point table
 * store the index into this big string.
 */

<%def name="strmap(strmap, prefix)">
static const char ${prefix}_strings[] =
% for s in strmap.sorted_strings:
    "${s.string}\\0"
% endfor
;

static const struct string_map_entry ${prefix}_string_map_entries[] = {
% for s in strmap.sorted_strings:
    { ${s.offset}, ${'{:0=#8x}'.format(s.hash)}, ${s.num} }, /* ${s.string} */
% endfor
};

/* Hash table stats:
 * size ${len(strmap.sorted_strings)} entries
 * collisions entries:
% for i in range(10):
 *     ${i}${'+' if i == 9 else ' '}     ${strmap.collisions[i]}
% endfor
 */

#define none 0xffff
static const uint16_t ${prefix}_string_map[${strmap.hash_size}] = {
% for e in strmap.mapping:
    ${ '{:0=#6x}'.format(e) if e >= 0 else 'none' },
% endfor
};

static int
${prefix}_string_map_lookup(const char *str)
{
    static const uint32_t prime_factor = ${strmap.prime_factor};
    static const uint32_t prime_step = ${strmap.prime_step};
    const struct string_map_entry *e;
    uint32_t hash, h;
    uint16_t i;
    const char *p;

    hash = 0;
    for (p = str; *p; p++)
        hash = hash * prime_factor + *p;

    h = hash;
    while (1) {
        i = ${prefix}_string_map[h & ${strmap.hash_mask}];
        if (i == none)
           return -1;
        e = &${prefix}_string_map_entries[i];
        if (e->hash == hash && strcmp(str, ${prefix}_strings + e->name) == 0)
            return e->num;
        h += prime_step;
    }

    return -1;
}
</%def>

${strmap(instance_strmap, 'instance')}
${strmap(physical_device_strmap, 'physical_device')}
${strmap(device_strmap, 'device')}

<% assert len(instance_entrypoints) < 2**8 %>
static const uint8_t instance_compaction_table[] = {
% for e in instance_entrypoints:
    ${e.disp_table_index},
% endfor
};

<% assert len(physical_device_entrypoints) < 2**8 %>
static const uint8_t physical_device_compaction_table[] = {
% for e in physical_device_entrypoints:
    ${e.disp_table_index},
% endfor
};

<% assert len(device_entrypoints) < 2**16 %>
static const uint16_t device_compaction_table[] = {
% for e in device_entrypoints:
    ${e.disp_table_index},
% endfor
};

static bool
vk_instance_entrypoint_is_enabled(int index, uint32_t core_version,
                                  const struct vk_instance_extension_table *instance)
{
   switch (index) {
% for e in instance_entrypoints:
   case ${e.entry_table_index}:
      /* ${e.name} */
   % if e.core_version:
      return ${e.core_version.c_vk_version()} <= core_version;
   % elif e.extensions:
     % for ext in e.extensions:
        % if ext.type == 'instance':
      if (instance->${ext.name[3:]}) return true;
        % else:
      /* All device extensions are considered enabled at the instance level */
      return true;
        % endif
     % endfor
      return false;
   % else:
      return true;
   % endif
% endfor
   default:
      return false;
   }
}

/** Return true if the core version or extension in which the given entrypoint
 * is defined is enabled.
 *
 * If device is NULL, all device extensions are considered enabled.
 */
static bool
vk_physical_device_entrypoint_is_enabled(int index, uint32_t core_version,
                                         const struct vk_instance_extension_table *instance)
{
   switch (index) {
% for e in physical_device_entrypoints:
   case ${e.entry_table_index}:
      /* ${e.name} */
   % if e.core_version:
      return ${e.core_version.c_vk_version()} <= core_version;
   % elif e.extensions:
     % for ext in e.extensions:
        % if ext.type == 'instance':
      if (instance->${ext.name[3:]}) return true;
        % else:
      /* All device extensions are considered enabled at the instance level */
      return true;
        % endif
     % endfor
      return false;
   % else:
      return true;
   % endif
% endfor
   default:
      return false;
   }
}

/** Return true if the core version or extension in which the given entrypoint
 * is defined is enabled.
 *
 * If device is NULL, all device extensions are considered enabled.
 */
static bool
vk_device_entrypoint_is_enabled(int index, uint32_t core_version,
                                const struct vk_instance_extension_table *instance,
                                const struct vk_device_extension_table *device)
{
   switch (index) {
% for e in device_entrypoints:
   case ${e.entry_table_index}:
      /* ${e.name} */
   % if e.core_version:
      return ${e.core_version.c_vk_version()} <= core_version;
   % elif e.extensions:
     % for ext in e.extensions:
        % if ext.type == 'instance':
      if (instance->${ext.name[3:]}) return true;
        % else:
      if (!device || device->${ext.name[3:]}) return true;
        % endif
     % endfor
      return false;
   % else:
      return true;
   % endif
% endfor
   default:
      return false;
   }
}

#ifdef _MSC_VER
VKAPI_ATTR void VKAPI_CALL vk_entrypoint_stub(void)
{
   UNREACHABLE("Entrypoint not implemented");
}

static const void *get_function_target(const void *func)
{
   const uint8_t *address = func;
#ifdef _M_X64
   /* Incremental linking may indirect through relative jump */
   if (*address == 0xE9)
   {
      /* Compute JMP target if the first byte is opcode 0xE9 */
      uint32_t offset;
      memcpy(&offset, address + 1, 4);
      address += offset + 5;
   }
#else
   /* Add other platforms here if necessary */
#endif
   return address;
}

static bool vk_function_is_stub(PFN_vkVoidFunction func)
{
   return (func == vk_entrypoint_stub) || (get_function_target(func) == get_function_target(vk_entrypoint_stub));
}
#endif

<%def name="dispatch_table_from_entrypoints(type)">
void vk_${type}_dispatch_table_from_entrypoints(
    struct vk_${type}_dispatch_table *dispatch_table,
    const struct vk_${type}_entrypoint_table *entrypoint_table,
    bool overwrite)
{
    PFN_vkVoidFunction *disp = (PFN_vkVoidFunction *)dispatch_table;
    PFN_vkVoidFunction *entry = (PFN_vkVoidFunction *)entrypoint_table;

    if (overwrite) {
        memset(dispatch_table, 0, sizeof(*dispatch_table));
        for (unsigned i = 0; i < ARRAY_SIZE(${type}_compaction_table); i++) {
#ifdef _MSC_VER
            assert(entry[i] != NULL);
            if (vk_function_is_stub(entry[i]))
#else
            if (entry[i] == NULL)
#endif
                continue;
            unsigned disp_index = ${type}_compaction_table[i];
            assert(disp[disp_index] == NULL);
            disp[disp_index] = entry[i];
        }
    } else {
        for (unsigned i = 0; i < ARRAY_SIZE(${type}_compaction_table); i++) {
            unsigned disp_index = ${type}_compaction_table[i];
#ifdef _MSC_VER
            assert(entry[i] != NULL);
            if (disp[disp_index] == NULL && !vk_function_is_stub(entry[i]))
#else
            if (disp[disp_index] == NULL)
#endif
                disp[disp_index] = entry[i];
        }
    }
}
</%def>

${dispatch_table_from_entrypoints('instance')}
${dispatch_table_from_entrypoints('physical_device')}
${dispatch_table_from_entrypoints('device')}

<%def name="lookup_funcs(type)">
static PFN_vkVoidFunction
vk_${type}_dispatch_table_get_for_entry_index(
    const struct vk_${type}_dispatch_table *table, int entry_index)
{
    assert(entry_index >= 0);
    assert((size_t)entry_index < ARRAY_SIZE(${type}_compaction_table));
    int disp_index = ${type}_compaction_table[entry_index];
    return ((PFN_vkVoidFunction *)table)[disp_index];
}

PFN_vkVoidFunction
vk_${type}_dispatch_table_get(
    const struct vk_${type}_dispatch_table *table, const char *name)
{
    int entry_index = ${type}_string_map_lookup(name);
    if (entry_index < 0)
        return NULL;

    return vk_${type}_dispatch_table_get_for_entry_index(table, entry_index);
}
</%def>

${lookup_funcs('instance')}
${lookup_funcs('physical_device')}
${lookup_funcs('device')}

PFN_vkVoidFunction
vk_instance_dispatch_table_get_if_supported(
    const struct vk_instance_dispatch_table *table,
    const char *name,
    uint32_t core_version,
    const struct vk_instance_extension_table *instance_exts)
{
    int entry_index = instance_string_map_lookup(name);
    if (entry_index < 0)
        return NULL;

    if (!vk_instance_entrypoint_is_enabled(entry_index, core_version,
                                           instance_exts))
        return NULL;

    return vk_instance_dispatch_table_get_for_entry_index(table, entry_index);
}

PFN_vkVoidFunction
vk_physical_device_dispatch_table_get_if_supported(
    const struct vk_physical_device_dispatch_table *table,
    const char *name,
    uint32_t core_version,
    const struct vk_instance_extension_table *instance_exts)
{
    int entry_index = physical_device_string_map_lookup(name);
    if (entry_index < 0)
        return NULL;

    if (!vk_physical_device_entrypoint_is_enabled(entry_index, core_version,
                                                  instance_exts))
        return NULL;

    return vk_physical_device_dispatch_table_get_for_entry_index(table, entry_index);
}

PFN_vkVoidFunction
vk_device_dispatch_table_get_if_supported(
    const struct vk_device_dispatch_table *table,
    const char *name,
    uint32_t core_version,
    const struct vk_instance_extension_table *instance_exts,
    const struct vk_device_extension_table *device_exts)
{
    int entry_index = device_string_map_lookup(name);
    if (entry_index < 0)
        return NULL;

    if (!vk_device_entrypoint_is_enabled(entry_index, core_version,
                                         instance_exts, device_exts))
        return NULL;

    return vk_device_dispatch_table_get_for_entry_index(table, entry_index);
}
""")

U32_MASK = 2**32 - 1

PRIME_FACTOR = 5024183
PRIME_STEP = 19

class StringIntMapEntry:
    def __init__(self, string, num):
        self.string = string
        self.num = num

        # Calculate the same hash value that we will calculate in C.
        h = 0
        for c in string:
            h = ((h * PRIME_FACTOR) + ord(c)) & U32_MASK
        self.hash = h

        self.offset = None

def round_to_pow2(x):
    return 2**int(math.ceil(math.log(x, 2)))

class StringIntMap:
    def __init__(self):
        self.baked = False
        self.strings = {}

    def add_string(self, string, num):
        assert not self.baked
        assert string not in self.strings
        assert 0 <= num < 2**31
        self.strings[string] = StringIntMapEntry(string, num)

    def bake(self):
        self.sorted_strings = \
            sorted(self.strings.values(), key=lambda x: x.string)
        offset = 0
        for entry in self.sorted_strings:
            entry.offset = offset
            offset += len(entry.string) + 1

        # Save off some values that we'll need in C
        self.hash_size = round_to_pow2(len(self.strings) * 1.25)
        self.hash_mask = self.hash_size - 1
        self.prime_factor = PRIME_FACTOR
        self.prime_step = PRIME_STEP

        self.mapping = [-1] * self.hash_size
        self.collisions = [0] * 10
        for idx, s in enumerate(self.sorted_strings):
            level = 0
            h = s.hash
            while self.mapping[h & self.hash_mask] >= 0:
                h = h + PRIME_STEP
                level = level + 1
            self.collisions[min(level, 9)] += 1
            self.mapping[h & self.hash_mask] = idx

def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('--out-c', help='Output C file.')
    parser.add_argument('--out-h', help='Output H file.')
    parser.add_argument('--beta', required=True, help='Enable beta extensions.')
    parser.add_argument('--xml',
                        help='Vulkan API XML file.',
                        required=True,
                        action='append',
                        dest='xml_files')
    args = parser.parse_args()

    entrypoints = get_entrypoints_from_xml(args.xml_files, args.beta)

    device_entrypoints = []
    physical_device_entrypoints = []
    instance_entrypoints = []
    for e in entrypoints:
        if e.is_device_entrypoint():
            device_entrypoints.append(e)
        elif e.is_physical_device_entrypoint():
            physical_device_entrypoints.append(e)
        else:
            instance_entrypoints.append(e)

    for i, e in enumerate(e for e in device_entrypoints if not e.alias):
        e.disp_table_index = i

    device_strmap = StringIntMap()
    for i, e in enumerate(device_entrypoints):
        e.entry_table_index = i
        device_strmap.add_string("vk" + e.name, e.entry_table_index)
    device_strmap.bake()

    for i, e in enumerate(e for e in physical_device_entrypoints if not e.alias):
        e.disp_table_index = i

    physical_device_strmap = StringIntMap()
    for i, e in enumerate(physical_device_entrypoints):
        e.entry_table_index = i
        physical_device_strmap.add_string("vk" + e.name, e.entry_table_index)
    physical_device_strmap.bake()

    for i, e in enumerate(e for e in instance_entrypoints if not e.alias):
        e.disp_table_index = i

    instance_strmap = StringIntMap()
    for i, e in enumerate(instance_entrypoints):
        e.entry_table_index = i
        instance_strmap.add_string("vk" + e.name, e.entry_table_index)
    instance_strmap.bake()

    # For outputting entrypoints.h we generate a anv_EntryPoint() prototype
    # per entry point.
    try:
        if args.out_h:
            with open(args.out_h, 'w', encoding='utf-8') as f:
                f.write(TEMPLATE_H.render(instance_entrypoints=instance_entrypoints,
                                          physical_device_entrypoints=physical_device_entrypoints,
                                          device_entrypoints=device_entrypoints,
                                          filename=os.path.basename(__file__)))
        if args.out_c:
            with open(args.out_c, 'w', encoding='utf-8') as f:
                f.write(TEMPLATE_C.render(instance_entrypoints=instance_entrypoints,
                                          physical_device_entrypoints=physical_device_entrypoints,
                                          device_entrypoints=device_entrypoints,
                                          instance_strmap=instance_strmap,
                                          physical_device_strmap=physical_device_strmap,
                                          device_strmap=device_strmap,
                                          filename=os.path.basename(__file__)))
    except Exception:
        # In the event there's an error, this imports some helpers from mako
        # to print a useful stack trace and prints it, then exits with
        # status 1, if python is run with debug; otherwise it just raises
        # the exception
        import sys
        from mako import exceptions
        print(exceptions.text_error_template().render(), file=sys.stderr)
        sys.exit(1)


if __name__ == '__main__':
    main()


================================================
FILE: bin/vk_entrypoints.py
================================================
# Copyright 2020 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sub license, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice (including the
# next paragraph) shall be included in all copies or substantial portions
# of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
# IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
# ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

import xml.etree.ElementTree as et

from collections import OrderedDict, namedtuple

# Mesa-local imports must be declared in meson variable
# '{file_without_suffix}_depend_files'.
from vk_extensions import get_all_required, filter_api

EntrypointParam = namedtuple('EntrypointParam', 'type name decl len')

class EntrypointBase:
    def __init__(self, name):
        assert name.startswith('vk')
        self.name = name[2:]
        self.alias = None
        self.guard = None
        self.entry_table_index = None
        # Extensions which require this entrypoint
        self.core_version = None
        self.extensions = []

    def prefixed_name(self, prefix):
        return prefix + '_' + self.name

class Entrypoint(EntrypointBase):
    def __init__(self, name, return_type, params):
        super(Entrypoint, self).__init__(name)
        self.return_type = return_type
        self.params = params
        self.guard = None
        self.aliases = []
        self.disp_table_index = None

    def is_physical_device_entrypoint(self):
        return self.params[0].type in ('VkPhysicalDevice', )

    def is_device_entrypoint(self):
        return self.params[0].type in ('VkDevice', 'VkCommandBuffer', 'VkQueue')

    def decl_params(self, start=0):
        return ', '.join(p.decl for p in self.params[start:])

    def call_params(self, start=0):
        return ', '.join(p.name for p in self.params[start:])

class EntrypointAlias(EntrypointBase):
    def __init__(self, name, entrypoint):
        super(EntrypointAlias, self).__init__(name)
        self.alias = entrypoint
        entrypoint.aliases.append(self)

    def is_physical_device_entrypoint(self):
        return self.alias.is_physical_device_entrypoint()

    def is_device_entrypoint(self):
        return self.alias.is_device_entrypoint()

    def prefixed_name(self, prefix):
        return self.alias.prefixed_name(prefix)

    @property
    def params(self):
        return self.alias.params

    @property
    def return_type(self):
        return self.alias.return_type

    @property
    def disp_table_index(self):
        return self.alias.disp_table_index

    def decl_params(self):
        return self.alias.decl_params()

    def call_params(self):
        return self.alias.call_params()

def get_entrypoints(doc, api, beta):
    """Extract the entry points from the registry."""
    entrypoints = OrderedDict()

    required = get_all_required(doc, 'command', api, beta)

    for command in doc.findall('./commands/command'):
        if not filter_api(command, api):
            continue

        if 'alias' in command.attrib:
            name = command.attrib['name']
            target = command.attrib['alias']
            e = EntrypointAlias(name, entrypoints[target])
        else:
            name = command.find('./proto/name').text
            ret_type = command.find('./proto/type').text
            params = [EntrypointParam(
                type=p.find('./type').text,
                name=p.find('./name').text,
                decl=''.join(p.itertext()),
                len=p.attrib.get('altlen', p.attrib.get('len', None))
            ) for p in command.findall('./param') if filter_api(p, api)]
            # They really need to be unique
            e = Entrypoint(name, ret_type, params)

        if name not in required:
            continue

        r = required[name]
        e.core_version = r.core_version
        e.extensions = r.extensions
        e.guard = r.guard

        assert name not in entrypoints, name
        entrypoints[name] = e

    return entrypoints.values()

def get_entrypoints_from_xml(xml_files, beta, api='vulkan'):
    entrypoints = []

    for filename in xml_files:
        doc = et.parse(filename)
        entrypoints += get_entrypoints(doc, api, beta)

    return entrypoints


================================================
FILE: bin/vk_extensions.py
================================================
import copy
import re
import xml.etree.ElementTree as et

def get_api_list(s):
    apis = []
    for a in s.split(','):
        if a == 'disabled':
            continue
        assert a in ('vulkan', 'vulkansc')
        apis.append(a)
    return apis

class Extension:
    def __init__(self, name, number, ext_version):
        self.name = name
        self.type = None
        self.number = number
        self.platform = None
        self.provisional = False
        self.ext_version = int(ext_version)
        self.supported = []

    def from_xml(ext_elem):
        name = ext_elem.attrib['name']
        number = int(ext_elem.attrib['number'])
        supported = get_api_list(ext_elem.attrib['supported'])
        if name == 'VK_ANDROID_native_buffer':
            assert not supported
            supported = ['vulkan']

        if not supported:
            return Extension(name, number, 0)

        version = None
        for enum_elem in ext_elem.findall('.require/enum'):
            if enum_elem.attrib['name'].endswith('_SPEC_VERSION'):
                # Skip alias SPEC_VERSIONs
                if 'value' in enum_elem.attrib:
                    assert version is None
                    version = int(enum_elem.attrib['value'])

        assert version is not None
        ext = Extension(name, number, version)
        ext.type = ext_elem.attrib['type']
        ext.platform = ext_elem.attrib.get('platform', None)
        ext.provisional = ext_elem.attrib.get('provisional', False)
        ext.supported = supported

        return ext

    def c_android_condition(self):
        # if it's an EXT or vendor extension, it's allowed
        if not self.name.startswith(ANDROID_EXTENSION_WHITELIST_PREFIXES):
            return 'true'

        allowed_version = ALLOWED_ANDROID_VERSION.get(self.name, None)
        if allowed_version is None:
            return 'false'

        return 'ANDROID_API_LEVEL >= %d' % (allowed_version)

class ApiVersion:
    def __init__(self, version):
        self.version = version

class VkVersion:
    def __init__(self, string):
        split = string.split('.')
        self.major = int(split[0])
        self.minor = int(split[1])
        if len(split) > 2:
            assert len(split) == 3
            self.patch = int(split[2])
        else:
            self.patch = None

        # Sanity check.  The range bits are required by the definition of the
        # VK_MAKE_VERSION macro
        assert self.major < 1024 and self.minor < 1024
        assert self.patch is None or self.patch < 4096
        assert str(self) == string

    def __str__(self):
        ver_list = [str(self.major), str(self.minor)]
        if self.patch is not None:
            ver_list.append(str(self.patch))
        return '.'.join(ver_list)

    def c_vk_version(self):
        ver_list = [str(self.major), str(self.minor), str(self.patch or 0)]
        return 'VK_MAKE_VERSION(' + ', '.join(ver_list) + ')'

    def __int_ver(self):
        # This is just an expansion of VK_VERSION
        return (self.major << 22) | (self.minor << 12) | (self.patch or 0)

    def __gt__(self, other):
        # If only one of them has a patch version, "ignore" it by making
        # other's patch version match self.
        if (self.patch is None) != (other.patch is None):
            other = copy.copy(other)
            other.patch = self.patch

        return self.__int_ver() > other.__int_ver()

    def __le__(self, other):
        return not self.__gt__(other)

# Sort the extension list the way we expect: KHR, then EXT, then vendors
# alphabetically. For digits, read them as a whole number sort that.
# eg.: VK_KHR_8bit_storage < VK_KHR_16bit_storage < VK_EXT_acquire_xlib_display
def extension_order(ext):
    order = []
    for substring in re.split('(KHR|EXT|[0-9]+)', ext.name):
        if substring == 'KHR':
            order.append(1)
        if substring == 'EXT':
            order.append(2)
        elif substring.isdigit():
            order.append(int(substring))
        else:
            order.append(substring)
    return order

def get_all_exts_from_xml(xml, api='vulkan'):
    """ Get a list of all Vulkan extensions. """

    xml = et.parse(xml)

    extensions = []
    for ext_elem in xml.findall('.extensions/extension'):
        ext = Extension.from_xml(ext_elem)
        if api in ext.supported:
            extensions.append(ext)

    return sorted(extensions, key=extension_order)

def init_exts_from_xml(xml, extensions, platform_defines):
    """ Walk the Vulkan XML and fill out extra extension information. """

    xml = et.parse(xml)

    ext_name_map = {}
    for ext in extensions:
        ext_name_map[ext.name] = ext

    # KHR_display is missing from the list.
    platform_defines.append('VK_USE_PLATFORM_DISPLAY_KHR')
    for platform in xml.findall('./platforms/platform'):
        platform_defines.append(platform.attrib['protect'])

    for ext_elem in xml.findall('.extensions/extension'):
        ext_name = ext_elem.attrib['name']
        if ext_name not in ext_name_map:
            continue

        ext = ext_name_map[ext_name]
        ext.type = ext_elem.attrib['type']

class Requirements:
    def __init__(self, core_version=None):
        self.core_version = core_version
        self.extensions = []
        self.guard = None

    def add_extension(self, ext):
        for e in self.extensions:
            if e == ext:
                return;
            assert e.name != ext.name

        self.extensions.append(ext)

def filter_api(elem, api):
    if 'api' not in elem.attrib:
        return True

    return api in elem.attrib['api'].split(',')

def get_alias(aliases, name):
    if name in aliases:
        # in case the spec registry adds an alias chain later
        return get_alias(aliases, aliases[name])
    return name

def get_all_required(xml, thing, api, beta):
    things = {}
    aliases = {}
    for struct in xml.findall('./types/type[@category="struct"][@alias]'):
        if not filter_api(struct, api):
            continue

        name = struct.attrib['name']
        alias = struct.attrib['alias']
        aliases[name] = alias

    for feature in xml.findall('./feature'):
        if not filter_api(feature, api):
            continue

        version = VkVersion(feature.attrib['number'])
        for t in feature.findall('./require/' + thing):
            name = t.attrib['name']
            if name in things:
                assert things[name].core_version <= version
            else:
                things[name] = Requirements(core_version=version)

    for extension in xml.findall('.extensions/extension'):
        ext = Extension.from_xml(extension)
        if api not in ext.supported:
            continue

        if beta != 'true' and ext.provisional:
            continue

        for require in extension.findall('./require'):
            if not filter_api(require, api):
                continue

            for t in require.findall('./' + thing):
                name = get_alias(aliases, t.attrib['name'])
                r = things.setdefault(name, Requirements())
                r.add_extension(ext)

    platform_defines = {}
    for platform in xml.findall('./platforms/platform'):
        name = platform.attrib['name']
        define = platform.attrib['protect']
        platform_defines[name] = define

    for req in things.values():
        if req.core_version is not None:
            continue

        for ext in req.extensions:
            if ext.platform in platform_defines:
                req.guard = platform_defines[ext.platform]
                break

    return things

# Mapping between extension name and the android version in which the extension
# was whitelisted in Android CTS's dEQP-VK.info.device_extensions and
# dEQP-VK.api.info.android.no_unknown_extensions, excluding those blocked by
# android.graphics.cts.VulkanFeaturesTest#testVulkanBlockedExtensions.
ALLOWED_ANDROID_VERSION = {
    # checkInstanceExtensions on oreo-cts-release
    "VK_KHR_surface": 26,
    "VK_KHR_display": 26,
    "VK_KHR_android_surface": 26,
    "VK_KHR_mir_surface": 26,
    "VK_KHR_wayland_surface": 26,
    "VK_KHR_win32_surface": 26,
    "VK_KHR_xcb_surface": 26,
    "VK_KHR_xlib_surface": 26,
    "VK_KHR_get_physical_device_properties2": 26,
    "VK_KHR_get_surface_capabilities2": 26,
    "VK_KHR_external_memory_capabilities": 26,
    "VK_KHR_external_semaphore_capabilities": 26,
    "VK_KHR_external_fence_capabilities": 26,
    # on pie-cts-release
    "VK_KHR_device_group_creation": 28,
    "VK_KHR_get_display_properties2": 28,
    # on android10-tests-release
    "VK_KHR_surface_protected_capabilities": 29,
    # on android13-tests-release
    "VK_KHR_portability_enumeration": 33,

    # checkDeviceExtensions on oreo-cts-release
    "VK_KHR_swapchain": 26,
    "VK_KHR_display_swapchain": 26,
    "VK_KHR_sampler_mirror_clamp_to_edge": 26,
    "VK_KHR_shader_draw_parameters": 26,
    "VK_KHR_maintenance1": 26,
    "VK_KHR_push_descriptor": 26,
    "VK_KHR_descriptor_update_template": 26,
    "VK_KHR_incremental_present": 26,
    "VK_KHR_shared_presentable_image": 26,
    "VK_KHR_storage_buffer_storage_class": 26,
    "VK_KHR_16bit_storage": 26,
    "VK_KHR_get_memory_requirements2": 26,
    "VK_KHR_external_memory": 26,
    "VK_KHR_external_memory_fd": 26,
    "VK_KHR_external_memory_win32": 26,
    "VK_KHR_external_semaphore": 26,
    "VK_KHR_external_semaphore_fd": 26,
    "VK_KHR_external_semaphore_win32": 26,
    "VK_KHR_external_fence": 26,
    "VK_KHR_external_fence_fd": 26,
    "VK_KHR_external_fence_win32": 26,
    "VK_KHR_win32_keyed_mutex": 26,
    "VK_KHR_dedicated_allocation": 26,
    "VK_KHR_variable_pointers": 26,
    "VK_KHR_relaxed_block_layout": 26,
    "VK_KHR_bind_memory2": 26,
    "VK_KHR_maintenance2": 26,
    "VK_KHR_image_format_list": 26,
    "VK_KHR_sampler_ycbcr_conversion": 26,
    # on oreo-mr1-cts-release
    "VK_KHR_draw_indirect_count": 27,
    # on pie-cts-release
    "VK_KHR_device_group": 28,
    "VK_KHR_multiview": 28,
    "VK_KHR_maintenance3": 28,
    "VK_KHR_create_renderpass2": 28,
    "VK_KHR_driver_properties": 28,
    # on android10-tests-release
    "VK_KHR_shader_float_controls": 29,
    "VK_KHR_shader_float16_int8": 29,
    "VK_KHR_8bit_storage": 29,
    "VK_KHR_depth_stencil_resolve": 29,
    "VK_KHR_swapchain_mutable_format": 29,
    "VK_KHR_shader_atomic_int64": 29,
    "VK_KHR_vulkan_memory_model": 29,
    "VK_KHR_swapchain_mutable_format": 29,
    "VK_KHR_uniform_buffer_standard_layout": 29,
    # on android11-tests-release
    "VK_KHR_imageless_framebuffer": 30,
    "VK_KHR_shader_subgroup_extended_types": 30,
    "VK_KHR_buffer_device_address": 30,
    "VK_KHR_separate_depth_stencil_layouts": 30,
    "VK_KHR_timeline_semaphore": 30,
    "VK_KHR_spirv_1_4": 30,
    "VK_KHR_pipeline_executable_properties": 30,
    "VK_KHR_shader_clock": 30,
    # blocked by testVulkanBlockedExtensions
    # "VK_KHR_performance_query": 30,
    "VK_KHR_shader_non_semantic_info": 30,
    "VK_KHR_copy_commands2": 30,
    # on android12-tests-release
    "VK_KHR_shader_terminate_invocation": 31,
    "VK_KHR_ray_tracing_pipeline": 31,
    "VK_KHR_ray_query": 31,
    "VK_KHR_acceleration_structure": 31,
    "VK_KHR_pipeline_library": 31,
    "VK_KHR_deferred_host_operations": 31,
    "VK_KHR_fragment_shading_rate": 31,
    "VK_KHR_zero_initialize_workgroup_memory": 31,
    "VK_KHR_workgroup_memory_explicit_layout": 31,
    "VK_KHR_synchronization2": 31,
    "VK_KHR_shader_integer_dot_product": 31,
    # on android13-tests-release
    "VK_KHR_dynamic_rendering": 33,
    "VK_KHR_format_feature_flags2": 33,
    "VK_KHR_global_priority": 33,
    "VK_KHR_maintenance4": 33,
    "VK_KHR_portability_subset": 33,
    "VK_KHR_present_id": 33,
    "VK_KHR_present_wait": 33,
    "VK_KHR_shader_subgroup_uniform_control_flow": 33,
    # on android14-tests-release
    "VK_KHR_fragment_shader_barycentric": 34,
    "VK_KHR_ray_tracing_maintenance1": 34,
    # blocked by testVulkanBlockedExtensions
    # "VK_KHR_video_decode_h264": 34,
    # "VK_KHR_video_decode_h265": 34,
    # "VK_KHR_video_decode_queue": 34,
    # "VK_KHR_video_queue": 34,
    # on android15-tests-release
    "VK_KHR_calibrated_timestamps": 35,
    "VK_KHR_cooperative_matrix": 35,
    "VK_KHR_dynamic_rendering_local_read": 35,
    "VK_KHR_index_type_uint8": 35,
    "VK_KHR_line_rasterization": 35,
    "VK_KHR_load_store_op_none": 35,
    "VK_KHR_maintenance5": 35,
    "VK_KHR_maintenance6": 35,
    "VK_KHR_map_memory2": 35,
    "VK_KHR_ray_tracing_position_fetch": 35,
    "VK_KHR_shader_expect_assume": 35,
    "VK_KHR_shader_float_controls2": 35,
    "VK_KHR_shader_maximal_reconvergence": 35,
    "VK_KHR_shader_quad_control": 35,
    "VK_KHR_shader_subgroup_rotate": 35,
    "VK_KHR_vertex_attribute_divisor": 35,
    # blocked by testVulkanBlockedExtensions
    # "VK_KHR_video_decode_av1": 35,
    # "VK_KHR_video_encode_h264": 35,
    # "VK_KHR_video_encode_h265": 35,
    # "VK_KHR_video_encode_queue": 35,
    # "VK_KHR_video_maintenance1": 35,

    # testNoUnknownExtensions on oreo-cts-release
    "VK_GOOGLE_display_timing": 26,
    # on pie-cts-release
    "VK_ANDROID_external_memory_android_hardware_buffer": 28,
    # on android11-tests-release
    "VK_GOOGLE_decorate_string": 30,
    "VK_GOOGLE_hlsl_functionality1": 30,
    # on android13-tests-release
    "VK_GOOGLE_surfaceless_query": 33,
    # on android15-tests-release
    "VK_ANDROID_external_format_resolve": 35,

    # this HAL extension is always allowed and will be filtered out by the
    # loader
    "VK_ANDROID_native_buffer": 26,
}

# Extensions with these prefixes are checked in Android CTS, and thus must be
# whitelisted per the preceding dict.
ANDROID_EXTENSION_WHITELIST_PREFIXES = (
    "VK_KHX",
    "VK_KHR",
    "VK_GOOGLE",
    "VK_ANDROID"
)


================================================
FILE: bin/vk_extensions_gen.py
================================================
COPYRIGHT = """\
/*
 * Copyright 2017 Intel Corporation
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sub license, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice (including the
 * next paragraph) shall be included in all copies or substantial portions
 * of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
"""

import argparse

from mako.template import Template

# Mesa-local imports must be declared in meson variable
# '{file_without_suffix}_depend_files'.
from vk_extensions import get_all_exts_from_xml, init_exts_from_xml

_TEMPLATE_H = Template(COPYRIGHT + """

#ifndef VK_EXTENSIONS_H
#define VK_EXTENSIONS_H

#include <stdbool.h>

<%def name="extension_table(type, extensions)">
#define VK_${type.upper()}_EXTENSION_COUNT ${len(extensions)}

extern const VkExtensionProperties vk_${type}_extensions[];

struct vk_${type}_extension_table {
   union {
      bool extensions[VK_${type.upper()}_EXTENSION_COUNT];
      struct {
%for ext in extensions:
         bool ${ext.name[3:]};
%endfor
      };

      /* Workaround for "error: too many initializers for vk_${type}_extension_table" */
      struct {
%for ext in extensions:
         bool ${ext.name[3:]};
%endfor
      } table;
   };
};
</%def>

${extension_table('instance', instance_extensions)}
${extension_table('device', device_extensions)}

struct vk_physical_device;

#ifdef ANDROID_STRICT
extern const struct vk_instance_extension_table vk_android_allowed_instance_extensions;
extern const struct vk_device_extension_table vk_android_allowed_device_extensions;
#endif

#endif /* VK_EXTENSIONS_H */
""")

_TEMPLATE_C = Template(COPYRIGHT + """
#include "vulkan/vulkan_core.h"

#include "vk_extensions.h"

const VkExtensionProperties vk_instance_extensions[VK_INSTANCE_EXTENSION_COUNT] = {
%for ext in instance_extensions:
   {"${ext.name}", ${ext.ext_version}},
%endfor
};

const VkExtensionProperties vk_device_extensions[VK_DEVICE_EXTENSION_COUNT] = {
%for ext in device_extensions:
   {"${ext.name}", ${ext.ext_version}},
%endfor
};

#ifdef ANDROID_STRICT
const struct vk_instance_extension_table vk_android_allowed_instance_extensions = {
%for ext in instance_extensions:
   .${ext.name[3:]} = ${ext.c_android_condition()},
%endfor
};

const struct vk_device_extension_table vk_android_allowed_device_extensions = {
%for ext in device_extensions:
   .${ext.name[3:]} = ${ext.c_android_condition()},
%endfor
};
#endif
""")

def gen_extensions(xml_files, extensions, out_c, out_h):
    platform_defines = []
    for filename in xml_files:
        init_exts_from_xml(filename, extensions, platform_defines)

    for ext in extensions:
        assert ext.type in {'instance', 'device'}

    template_env = {
        'instance_extensions': [e for e in extensions if e.type == 'instance'],
        'device_extensions': [e for e in extensions if e.type == 'device'],
        'platform_defines': platform_defines,
    }

    if out_h:
        with open(out_h, 'w', encoding='utf-8') as f:
            f.write(_TEMPLATE_H.render(**template_env))

    if out_c:
        with open(out_c, 'w', encoding='utf-8') as f:
            f.write(_TEMPLATE_C.render(**template_env))


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('--out-c', help='Output C file.')
    parser.add_argument('--out-h', help='Output H file.')
    parser.add_argument('--xml',
                        help='Vulkan API XML file.',
                        required=True,
                        action='append',
                        dest='xml_files')
    args = parser.parse_args()

    extensions = []
    for filename in args.xml_files:
        extensions += get_all_exts_from_xml(filename)

    gen_extensions(args.xml_files, extensions, args.out_c, args.out_h)

if __name__ == '__main__':
    main()


================================================
FILE: build-source.sh
================================================
#!/bin/sh

VERSION=$(git describe --tags --dirty)
NAME=MangoHud-${VERSION}
TAR_NAME=${NAME}-Source.tar.xz
DFSG_TAR_NAME=${NAME}-Source-DFSG.tar.xz

# remove existing files
rm -rf sourcedir
rm -rf ${NAME}
rm -f ${TAR_NAME}
rm -f ${DFSG_TAR_NAME}

# create tarball with meson
meson setup sourcedir
meson dist --formats=xztar --include-subprojects --no-tests -C sourcedir
mv sourcedir/meson-dist/*.tar.xz ${TAR_NAME}

# create DFSG compliant version
# unpack since tarball is compressed
mkdir ${NAME}
tar -xf ${TAR_NAME} --strip 1 -C ${NAME}
# nvml.h is not DFSG compliant
rm ${NAME}/include/nvml.h
# minhook not needed
rm -r ${NAME}/modules/minhook
# spdlog from system
rm -r ${NAME}/subprojects/spdlog-*
# nlohmann_json from system
rm -r ${NAME}/subprojects/nlohmann_json-*
# remove some vulkan clutter
rm -r ${NAME}/subprojects/Vulkan-Headers-*/cmake ${NAME}/subprojects/Vulkan-Headers-*/BUILD.gn
# remove some dear imgui clutter
rm -rf ${NAME}/subprojects/imgui-*/examples
# compress new sources
tar -cJf ${DFSG_TAR_NAME} ${NAME}

# cleanup
rm -r sourcedir
rm -r ${NAME}


================================================
FILE: build-srt.sh
================================================
#!/usr/bin/env bash
# Specialized build script for Steam Runtime SDK docker
set -e

IFS=" " read -ra debian_chroot < /etc/debian_chroot
LOCAL_CC=${CC:-gcc-5}
LOCAL_CXX=${CXX:-g++-5}
RUNTIME=${RUNTIME:-${debian_chroot[1]}}
SRT_VERSION=${SRT_VERSION:-${debian_chroot[2]}}
VERSION=$(git describe --long --tags --always | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//')

dependencies() {

    if [[ ! -f build-srt/release/usr/lib/libMangoHud.so ]]; then
        install() {
            set +e
            for i in ${DEPS[@]}; do
                dpkg-query -s "$i" &> /dev/null
                if [[ $? == 1 ]]; then
                    INSTALL="$INSTALL""$i "
                fi
            done
            if [[ ! -z "$INSTALL" ]]; then
                apt-get update
                apt-get -y install $INSTALL
            fi
            set -e
        }

        echo "# Checking Dependencies"
        DEPS=(${LOCAL_CC}-multilib ${LOCAL_CXX}-multilib unzip)
        install


        # use py3.5 with scout, otherwise hope python is new enough
        set +e
        which python3.5 >/dev/null
        if [ $? -eq 0 ]; then
            # py3.2 is weird
            ln -sf python3.5 /usr/bin/python3
        fi
        set -e

        if [[ ! -f ./bin/get-pip.py ]]; then
            curl https://bootstrap.pypa.io/pip/3.5/get-pip.py -o bin/get-pip.py
            python3 ./bin/get-pip.py
        fi
        pip3 install 'meson>=0.54' mako

        if [[ ! -f /usr/include/NVCtrl/NVCtrl.h ]]; then
            curl -LO http://mirrors.kernel.org/ubuntu/pool/main/n/nvidia-settings/libxnvctrl0_440.64-0ubuntu1_amd64.deb
            curl -LO http://mirrors.kernel.org/ubuntu/pool/main/n/nvidia-settings/libxnvctrl-dev_440.64-0ubuntu1_amd64.deb
            dpkg -i libxnvctrl0_440.64-0ubuntu1_amd64.deb libxnvctrl-dev_440.64-0ubuntu1_amd64.deb
        fi

        # preinstalled 7.10.xxxx
        #if [[ ! -f /usr/local/bin/glslangValidator ]]; then
        #    curl -LO https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-linux-Release.zip
        #    unzip glslang-master-linux-Release.zip bin/glslangValidator
        #    /usr/bin/install -m755 bin/glslangValidator /usr/local/bin/
        #    rm bin/glslangValidator glslang-master-linux-Release.zip
        #fi
    fi
}

configure() {
    dependencies
    git submodule update --init
    if [[ ! -f "build-srt/meson64/build.ninja" ]]; then
        export CC="${LOCAL_CC}"
        export CXX="${LOCAL_CXX}"
        meson build-srt/meson64 --libdir lib/mangohud/lib --prefix /usr -Dappend_libdir_mangohud=false $@ ${CONFIGURE_OPTS}
    fi
    if [[ ! -f "build-srt/meson32/build.ninja" ]]; then
        export CC="${LOCAL_CC} -m32"
        export CXX="${LOCAL_CXX} -m32"
        export PKG_CONFIG_PATH="/usr/lib32/pkgconfig:/usr/lib/i386-linux-gnu/pkgconfig:/usr/lib/pkgconfig:${PKG_CONFIG_PATH_32}"
        meson build-srt/meson32 --libdir lib/mangohud/lib32 --prefix /usr -Dappend_libdir_mangohud=false $@ ${CONFIGURE_OPTS}
    fi
}

build() {
    if [[ ! -f "build-srt/meson64/build.ninja" || ! -f "build-srt/meson32/build.ninja" ]]; then
        configure $@
    fi
    DESTDIR="$PWD/build-srt/release" ninja -C build-srt/meson32 install
    DESTDIR="$PWD/build-srt/release" ninja -C build-srt/meson64 install
}

package() {
    LIB="build-srt/release/usr/lib/mangohud/lib/libMangoHud.so"
    LIB32="build-srt/release/usr/lib/mangohud/lib32/libMangoHud.so"
    if [[ ! -f "$LIB" || "$LIB" -ot "build-srt/meson64/src/libMangoHud.so" ]]; then
        build
    fi
    tar --numeric-owner --owner=0 --group=0 \
        -C build-srt/release -cvf "build-srt/MangoHud-package.tar" .
}

release() {
    rm build-srt/MangoHud-package.tar
    mkdir -p build-srt/MangoHud
    package
    cp --preserve=mode bin/mangohud-setup.sh build-srt/MangoHud/mangohud-setup.sh
    cp build-srt/MangoHud-package.tar build-srt/MangoHud/MangoHud-package.tar
    tar --numeric-owner --owner=0 --group=0 \
        -C build-srt -czvf build-srt/MangoHud-${VERSION}_${RUNTIME}-${SRT_VERSION}.tar.gz MangoHud
}

clean() {
    rm -rf "build-srt/"
}

usage() {
    if test -z $1; then
        echo "Unrecognized command argument: $a"
    else
        echo "$0 requires one argument"
    fi
    echo -e "\nUsage: $0 <command>\n"
    echo "Available commands:"
    echo -e "\tpull\t\tPull latest commits (code) from Git"
    echo -e "\tconfigure\tEnsures that dependencies are installed, updates git submodules, and generates files needed for building MangoHud. This is automatically run by the build command"
    echo -e "\tbuild\t\tIf needed runs configure and then builds (compiles) MangoHud"
    echo -e "\tpackage\t\tRuns build if needed and then builds a tar package from MangoHud"
    echo -e "\tclean\t\tRemoves build directory"
    echo -e "\trelease\t\tBuilds a MangoHud release tar package"
}

if [[ -z $@ ]]; then
    usage no-args
fi

while [ $# -gt 0 ]; do
    OPTS=()
    arg="$1"
    shift

    while [ $# -gt 0 ] ; do
        case $1 in
        -*)
            OPTS+=("$1")
            shift
        ;;
        *)
            break
        ;;
        esac;
    done

    echo -e "\e[1mCommand:\e[92m" $arg "\e[94m"${OPTS[@]}"\e[39m\e[0m"
    case $arg in
        "configure") configure ${OPTS[@]};;
        "build") build ${OPTS[@]};;
        "package") package;;
        "clean") clean;;
        "release") release;;
        *)
            usage
    esac
done


================================================
FILE: build-with-srt-docker.sh
================================================
#!/usr/bin/env bash
# Usage example: $0 master soldier 0.20210618.0
set -u

if [ $# -eq 2 ]; then
  echo Specify runtime version too
  exit 1
fi

SRCDIR=$PWD
BRANCH="${1:-master}"
# soldier 0.20210618.0 or newer
# scout 0.20210630.0 or newer
RUNTIME="${2:-soldier}"
VERSION="${3:-0.20210618.0}"
IMAGE="steamrt_${RUNTIME}_${VERSION}_amd64:mango-${RUNTIME}"
BASEURL="https://repo.steampowered.com/steamrt-images-${RUNTIME}/snapshots/${VERSION}"
CACHEDIR="./cache/steamrt-images-${RUNTIME}/snapshots/${VERSION}"

mkdir -p "${CACHEDIR}"

echo -e "\e[1mBuilding branch \e[92m${BRANCH}\e[39m using \e[92m${RUNTIME}:${VERSION}\e[39m runtime\e[0m"

if ! docker inspect --type=image ${IMAGE} 2>&1 >/dev/null ; then
  rm -fr ./cache/empty
  set -e
  mkdir -p ./cache/empty
  sed "s/%RUNTIME%/${RUNTIME}/g" steamrt.Dockerfile.in  > ./cache/steamrt.Dockerfile

  wget -P "${CACHEDIR}" -c ${BASEURL}/com.valvesoftware.SteamRuntime.Sdk-amd64,i386-${RUNTIME}-sysroot.tar.gz
  cp --reflink=always "${CACHEDIR}/com.valvesoftware.SteamRuntime.Sdk-amd64,i386-${RUNTIME}-sysroot.tar.gz" ./cache/empty/
  docker build -f ./cache/steamrt.Dockerfile -t ${IMAGE} ./cache/empty
fi

docker run --entrypoint=/bin/sh --rm -i -v "${SRCDIR}/srt-output:/output" ${IMAGE} << EOF
export RUNTIME=${RUNTIME}
export SRT_VERSION=${VERSION}
git clone git://github.com/flightlessmango/MangoHud.git . --branch ${BRANCH} --recurse-submodules --progress
./build-srt.sh clean build package release
cp -v build-srt/MangoHud*tar.gz /output/
EOF


================================================
FILE: build.sh
================================================
#!/usr/bin/env bash
set -e

# Import the variables for dependencies
source ./build_deps.sh

OS_RELEASE_FILES=("/etc/os-release" "/usr/lib/os-release")
XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
CONFIG_DIR="$XDG_CONFIG_HOME/MangoHud"
VERSION=$(git describe --long --tags --always | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//')
SU_CMD=$(command -v sudo || command -v doas || echo)
MACHINE=$(uname -m || echo)

# doas requires a double dash if the command it runs will include any dashes,
# so append a double dash to the command
[[ $SU_CMD == *doas ]] && SU_CMD="$SU_CMD -- "

# Correctly identify the os-release file.
for os_release in ${OS_RELEASE_FILES[@]} ; do
    if [[ ! -e "${os_release}" ]]; then
        continue
    fi
    DISTRO=$(sed -rn 's/^ID(_LIKE)*=(.+)/\L\2/p' ${os_release} | sed 's/"//g')
done

dependencies() {
    if [[ ! -f build/release/usr/lib/libMangoHud.so ]]; then
        missing_deps() {
            echo "# Missing dependencies:$INSTALL"
            read -rp "Do you wish the script to install these packages? [y/N]" PERMISSION
            case "$PERMISSION" in
                "y"|"Y") echo "Attempting to install missing packages"; sleep 0.5;;
                *) echo "Continuing with missing dependencies"; sleep 1;;
            esac
        }
        dep_install() {
            set +e
            for i in $(eval echo $DEPS); do
                $MANAGER_QUERY "$i" &> /dev/null
                if [[ $? == 1 ]]; then
                    INSTALL="$INSTALL""$i "
                fi
            done
            if [[ ! -z "$INSTALL" ]]; then
                missing_deps
                if [[ "$PERMISSION" == "Y" || "$PERMISSION" == "y" ]]; then
                    $SU_CMD $MANAGER_INSTALL $INSTALL
                fi
            fi
            set -e
        }

        for i in $DISTRO; do
        echo "# Checking dependencies for \"$i\""
        case $i in
            *arch*|*manjaro*|*artix*|*SteamOS*)
                MANAGER_QUERY="pacman -Q"
                MANAGER_INSTALL="pacman -S"
                DEPS="{${DEPS_ARCH}}"
                dep_install
                break
            ;;
            *fedora*|*nobara*)
                MANAGER_QUERY="dnf list installed"
                MANAGER_INSTALL="dnf install"
                DEPS="{${DEPS_FEDORA}}"
                dep_install

                unset INSTALL
                DEPS="{glibc-devel.i686,libstdc++-devel.i686,libX11-devel.i686,wayland-devel.i686,libxkbcommon-devel.i686}"
                dep_install
                break
            ;;

            *debian*|*ubuntu*|*deepin*|*pop*)
                MANAGER_QUERY="dpkg-query -s"
                MANAGER_INSTALL="apt install"
                DEPS="{${DEPS_DEBIAN}}"

                if ! dpkg --print-foreign-architectures | grep i386 > /dev/null; then
                    echo "i386 architecture is not enabled. adding it."
                    $SU_CMD dpkg --add-architecture i386
                    $SU_CMD apt update
                fi

                dep_install

                if [[ ! -f /usr/local/bin/glslangValidator ]]; then
                    wget https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-linux-Release.zip
                    unzip glslang-master-linux-Release.zip bin/glslangValidator
                    $SU_CMD /usr/bin/install -m755 bin/glslangValidator /usr/local/bin/
                    rm bin/glslangValidator glslang-master-linux-Release.zip
                fi
                break
            ;;
            *suse*)
                echo "You may have to enable packman repository for some extra packages: ${DEPS_SUSE_EXTRA}"
                echo "Leap:       zypper ar -cfp 90 https://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Leap_15.1/ packman"
                echo "Tumbleweed: zypper ar -cfp 90 http://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Tumbleweed/ packman"

                MANAGER_QUERY="rpm -q"
                MANAGER_INSTALL="zypper install"
                DEPS="{${DEPS_SUSE},${DEPS_SUSE_EXTRA}}"
                dep_install

                if [[ $(pip3 show meson; echo $?) == 1 ]]; then
                    $SU_CMD pip3 install 'meson>=0.54'
                fi
                break
            ;;
            *solus*)
                unset MANAGER_QUERY
                unset DEPS
                MANAGER_INSTALL="eopkg it"

                local packages=(${DEPS_SOLUS//,/ })

                # eopkg doesn't emit exit codes properly, so use the python API to find if a package is installed.
                for package in ${packages[@]}; do
                    python -c "import pisi.db; import sys; idb = pisi.db.installdb.InstallDB(); sys.exit(0 if idb.has_package(\"${package}\") else 1)"
                    if [[ $? -ne 0 ]]; then
                        INSTALL="${INSTALL}""${package} "
                    fi
                done

                # likewise, ensure the whole system.devel component is satisfied
                python -c "import pisi.db; import sys; idb = pisi.db.installdb.InstallDB(); cdb = pisi.db.componentdb.ComponentDB(); mpkgs = [x for x in cdb.get_packages('system.devel') if not idb.has_package(x)]; sys.exit(0 if len(mpkgs) == 0 else 1)"

                if [[ $? -ne 0 ]]; then
                    INSTALL="${INSTALL}""-c system.devel "
                fi
                dep_install
                break
                ;;
            *)
                echo "# Unable to find distro information!"
                echo "# Attempting to build regardless"
        esac
        done
    fi
}

configure() {
    dependencies
    git submodule update --init --depth 50
    CONFIGURE_OPTS="-Dwerror=true"
    if [[ ! -f "build/meson64/build.ninja" ]]; then
        meson setup build/meson64 --libdir lib/mangohud/lib64 --prefix /usr -Dappend_libdir_mangohud=false $@ ${CONFIGURE_OPTS}
    fi
    if [[ ! -f "build/meson32/build.ninja" && "$MACHINE" = "x86_64" ]]; then
        export CC="gcc -m32"
        export CXX="g++ -m32"
        export PKG_CONFIG_PATH="/usr/lib32/pkgconfig:/usr/lib/i386-linux-gnu/pkgconfig:/usr/lib/pkgconfig:${PKG_CONFIG_PATH_32}"
        meson setup build/meson32 --libdir lib/mangohud/lib32 --prefix /usr -Dappend_libdir_mangohud=false $@ ${CONFIGURE_OPTS}
    fi
}

build() {
    if [[ ! -f "build/meson64/build.ninja" ]]; then
        configure $@
    fi
    DESTDIR="$PWD/build/release" ninja -C build/meson64 install

    if [ "$MACHINE" = "x86_64" ]; then
        DESTDIR="$PWD/build/release" ninja -C build/meson32 install
    fi

    sed -i 's:/usr/\\$LIB:/usr/lib/mangohud/\\$LIB:g' "$PWD/build/release/usr/bin/mangohud"
}

package() {
    LIB="build/release/usr/lib/mangohud/lib64/libMangoHud.so"
    LIB32="build/release/usr/lib/mangohud/lib32/libMangoHud.so"
    if [[ ! -f "$LIB" || "$LIB" -ot "build/meson64/src/libMangoHud.so" ]]; then
        build
    fi
    tar --numeric-owner --owner=0 --group=0 \
        -C build/release -cvf "build/MangoHud-package.tar" .
}

release() {
    rm build/MangoHud-package.tar
    mkdir -p build/MangoHud
    package
    cp --preserve=mode bin/mangohud-setup.sh build/MangoHud/mangohud-setup.sh
    cp build/MangoHud-package.tar build/MangoHud/MangoHud-package.tar
    tar --numeric-owner --owner=0 --group=0 \
        -C build -czvf build/MangoHud-$VERSION.tar.gz MangoHud
}

uninstall() {
    [ "$UID" -eq 0 ] || exec $SU_CMD bash "$0" uninstall
    rm -rfv "/usr/lib/mangohud"
    rm -rfv "/usr/share/doc/mangohud"
    rm -fv "/usr/share/man/man1/mangohud.1"
    rm -fv "/usr/share/vulkan/implicit_layer.d/mangohud.json"
    rm -fv "/usr/share/vulkan/implicit_layer.d/MangoHud.json"
    rm -fv "/usr/share/vulkan/implicit_layer.d/MangoHud.x86.json"
    rm -fv "/usr/share/vulkan/implicit_layer.d/MangoHud.x86_64.json"
    rm -fv "/usr/bin/mangohud"
    rm -fv "/usr/bin/mangoplot"
    rm -fv "/usr/bin/mangohud.x86"
}

install() {
    rm -rf "$HOME/.local/share/MangoHud/"
    rm -f "$HOME/.local/share/vulkan/implicit_layer.d/"{mangohud32.json,mangohud64.json}

    [ "$UID" -eq 0 ] || mkdir -pv "${CONFIG_DIR}"
    [ "$UID" -eq 0 ] || build
    [ "$UID" -eq 0 ] || exec $SU_CMD bash "$0" install

    uninstall

    DEFAULTLIB=lib32
    for i in $DISTRO; do
        case $i in
            *arch*)
            DEFAULTLIB=lib64
            ;;
        esac
    done

    if [ "$MACHINE" != "x86_64" ]; then
        # Native libs
        DEFAULTLIB=lib64
    fi

    echo DEFAULTLIB: $DEFAULTLIB
    /usr/bin/install -Dvm644 ./build/release/usr/lib/mangohud/lib64/libMangoHud.so /usr/lib/mangohud/lib64/libMangoHud.so
    /usr/bin/install -Dvm644 ./build/release/usr/lib/mangohud/lib64/libMangoHud_opengl.so /usr/lib/mangohud/lib64/libMangoHud_opengl.so
    /usr/bin/install -Dvm644 ./build/release/usr/lib/mangohud/lib64/libMangoHud_shim.so /usr/lib/mangohud/lib64/libMangoHud_shim.so
    if [ "$MACHINE" = "x86_64" ]; then
      /usr/bin/install -Dvm644 ./build/release/usr/lib/mangohud/lib32/libMangoHud.so /usr/lib/mangohud/lib32/libMangoHud.so
      /usr/bin/install -Dvm644 ./build/release/usr/lib/mangohud/lib32/libMangoHud_opengl.so /usr/lib/mangohud/lib32/libMangoHud_opengl.so
      /usr/bin/install -Dvm644 ./build/release/usr/lib/mangohud/lib32/libMangoHud_shim.so /usr/lib/mangohud/lib32/libMangoHud_shim.so
    fi

    /usr/bin/install -Dvm644 ./build/release/usr/share/vulkan/implicit_layer.d/MangoHud.x86_64.json /usr/share/vulkan/implicit_layer.d/MangoHud.x86_64.json
    /usr/bin/install -Dvm644 ./build/release/usr/share/vulkan/implicit_layer.d/MangoHud.x86.json /usr/share/vulkan/implicit_layer.d/MangoHud.x86.json
    /usr/bin/install -Dvm644 ./build/release/usr/share/man/man1/mangohud.1 /usr/share/man/man1/mangohud.1
    /usr/bin/install -Dvm644 ./build/release/usr/share/doc/mangohud/MangoHud.conf.example /usr/share/doc/mangohud/MangoHud.conf.example
    /usr/bin/install -vm755  ./build/release/usr/bin/mangohud /usr/bin/mangohud
    /usr/bin/install -vm755  ./build/release/usr/bin/mangoplot /usr/bin/mangoplot

    ln -sv $DEFAULTLIB /usr/lib/mangohud/lib

    # FIXME get the triplet somehow
    ln -sv lib64 /usr/lib/mangohud/x86_64
    ln -sv lib64 /usr/lib/mangohud/x86_64-linux-gnu
    ln -sv . /usr/lib/mangohud/lib64/x86_64
    ln -sv . /usr/lib/mangohud/lib64/x86_64-linux-gnu

    ln -sv lib32 /usr/lib/mangohud/i686
    ln -sv lib32 /usr/lib/mangohud/i386-linux-gnu
    ln -sv lib32 /usr/lib/mangohud/i686-linux-gnu

    mkdir -p /usr/lib/mangohud/tls
    ln -sv ../lib64 /usr/lib/mangohud/tls/x86_64
    ln -sv ../lib32 /usr/lib/mangohud/tls/i686

    # Some distros search in $prefix/x86_64-linux-gnu/tls/x86_64 etc instead
    if [ ! -e /usr/lib/mangohud/lib/i386-linux-gnu ]; then
        ln -sv ../lib32 /usr/lib/mangohud/lib/i386-linux-gnu
    fi
    if [ ! -e /usr/lib/mangohud/lib/i686-linux-gnu ]; then
        ln -sv ../lib32 /usr/lib/mangohud/lib/i686-linux-gnu
    fi
    if [ ! -e /usr/lib/mangohud/lib/x86_64-linux-gnu ]; then
        ln -sv ../lib64 /usr/lib/mangohud/lib/x86_64-linux-gnu
    fi

    # $LIB can be "lib/tls/x86_64"?
    ln -sv ../tls /usr/lib/mangohud/lib/tls

    #ln -sv lib64 /usr/lib/mangohud/aarch64-linux-gnu
    #ln -sv lib64 /usr/lib/mangohud/arm-linux-gnueabihf

    echo "MangoHud Installed"
}

reinstall() {
    build
    package
    install
}

clean() {
    rm -rf "build"
    rm -rf subprojects/*/
}

usage() {
    if test -z $1; then
        echo "Unrecognized command argument: $arg"
    else
        echo "$0 requires one argument"
    fi
    echo -e "\nUsage: $0 <command>\n"
    echo "Available commands:"
    echo -e "\tpull\t\tPull latest commits (code) from Git"
    echo -e "\tconfigure\tEnsures that dependencies are installed, updates git submodules, and generates files needed for building MangoHud. This is automatically run by the build command"
    echo -e "\tbuild\t\tIf needed runs configure and then builds (compiles) MangoHud"
    echo -e "\tpackage\t\tRuns build if needed and then builds a tar package from MangoHud"
    echo -e "\tinstall\t\tInstall MangoHud onto your system"
    echo -e "\treinstall\tRuns build, then package, and finally install"
    echo -e "\tclean\t\tRemoves build directory"
    echo -e "\tuninstall\tRemoves installed MangoHud files from your system"
    echo -e "\trelease\t\tBuilds a MangoHud release tar package"
}

if [[ -z $@ ]]; then
    usage no-args
fi

while [ $# -gt 0 ]; do
    OPTS=()
    arg="$1"
    shift

    while [ $# -gt 0 ] ; do
        case $1 in
        -*)
            OPTS+=("$1")
            shift
        ;;
        *)
            break
        ;;
        esac;
    done

    echo -e "\e[1mCommand:\e[92m" $arg "\e[94m"${OPTS[@]}"\e[39m\e[0m"
    case $arg in
        "pull") git pull ${OPTS[@]};;
        "configure") configure ${OPTS[@]};;
        "build") build ${OPTS[@]};;
        "build_dbg") build --buildtype=debug -Dglibcxx_asserts=true ${OPTS[@]};;
        "package") package;;
        "install") install;;
        "reinstall") reinstall;;
        "clean") clean;;
        "uninstall") uninstall;;
        "release") release;;
        *)
            usage
    esac
done


================================================
FILE: build_deps.sh
================================================
DEPS_ARCH="gcc,meson,pkgconf,python-mako,glslang,libglvnd,lib32-libglvnd,libxnvctrl,libdrm,python-numpy,python-matplotlib,libxkbcommon,lib32-libxkbcommon"
DEPS_FEDORA="meson,gcc,gcc-c++,libX11-devel,glslang,python3-mako,mesa-libGL-devel,libXNVCtrl-devel,dbus-devel,python3-numpy,python3-matplotlib,libstdc++-static,libstdc++-static.i686,libxkbcommon-devel,wayland-devel"
DEPS_DEBIAN="gcc,g++,gcc-multilib,g++-multilib,ninja-build,meson,python3-mako,python3-setuptools,python3-wheel,pkg-config,mesa-common-dev,libx11-dev,libxnvctrl-dev,libdbus-1-dev,python3-numpy,python3-matplotlib,libxkbcommon-dev,libxkbcommon-dev:i386,libwayland-dev,libwayland-dev:i386"
DEPS_SOLUS="mesalib-32bit-devel,glslang,libstdc++-32bit,glibc-32bit-devel,mako,numpy,matplotlib,libxkbcommon-devel"

DEPS_SUSE="gcc-c++,gcc-c++-32bit,libpkgconf-devel,ninja,python3-pip,python3-Mako,libX11-devel,glslang-devel,glibc-devel,glibc-devel-32bit,libstdc++-devel,libstdc++-devel-32bit,Mesa-libGL-devel,dbus-1-devel,python-numpy,python-matplotlib,libxkbcommon-devel,libxkbcommon-devel-32bit,wayland-devel-32bit"
DEPS_SUSE_EXTRA="libXNVCtrl-devel"


================================================
FILE: control/setup.cfg
================================================
[metadata]
name = mangohud_control
version = 0.0.1
author = Simon Hallsten
author_email = flightlessmangoyt@gmail.com
description = control interface for mangohud
classifiers =
    Programming Language :: Python :: 3
    License :: OSI Approved :: MIT License
    Operating System :: Linux

[options]
package_dir =
  = src

packages = find:
python_requires = >=3.6

[options.packages.find]
where = src

[options.entry_points]
console_scripts =
    mangohud-control = control:main

[pycodestyle]
max-line-length = 160

================================================
FILE: control/setup.py
================================================
import site
import sys
from setuptools import setup

if __name__ == "__main__":
    setup()

# See https://github.com/pypa/pip/issues/7953
site.ENABLE_USER_SITE = "--user" in sys.argv[1:]


================================================
FILE: control/src/control/__init__.py
================================================
#!/usr/bin/env python3
import os
import socket
import sys
import select
from select import EPOLLIN, EPOLLPRI, EPOLLERR
import time
from collections import namedtuple
import argparse

TIMEOUT = 1.0 # seconds

VERSION_HEADER = bytearray('MangoHudControlVersion', 'utf-8')
DEVICE_NAME_HEADER = bytearray('DeviceName', 'utf-8')
MANGOHUD_VERSION_HEADER = bytearray('MangoHudVersion', 'utf-8')

DEFAULT_SERVER_ADDRESS = "\0mangohud"

class Connection:
    def __init__(self, path):
        # Create a Unix Domain socket and connect
        sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
        try:
            sock.connect(path)
        except socket.error as msg:
            print(msg)
            sys.exit(1)

        self.sock = sock

        # initialize poll interface and register socket
        epoll = select.epoll()
        epoll.register(sock, EPOLLIN | EPOLLPRI | EPOLLERR)
        self.epoll = epoll

    def recv(self, timeout):
        '''
        timeout as float in seconds
        returns:
            - None on error or disconnection
            - bytes() (empty) on timeout
        '''

        events = self.epoll.poll(timeout)
        for ev in events:
            (fd, event) = ev
            if fd != self.sock.fileno():
                continue

            # check for socket error
            if event & EPOLLERR:
                return None

            # EPOLLIN or EPOLLPRI, just read the message
            msg = self.sock.recv(4096)

            # socket disconnected
            if len(msg) == 0:
                return None

            return msg

        return bytes()

    def send(self, msg):
        self.sock.send(msg)

class MsgParser:
    MSGBEGIN = bytes(':', 'utf-8')[0]
    MSGEND = bytes(';', 'utf-8')[0]
    MSGSEP = bytes('=', 'utf-8')[0]

    def __init__(self, conn):
        self.cmdpos = 0
        self.parampos = 0
        self.bufferpos = 0
        self.reading_cmd = False
        self.reading_param = False
        self.buffer = None
        self.cmd = bytearray(4096)
        self.param = bytearray(4096)

        self.conn = conn

    def readCmd(self, ncmds, timeout=TIMEOUT):
        '''
        returns:
            - None on error or disconnection
            - bytes() (empty) on timeout
        '''

        parsed = []

        remaining = timeout

        while remaining > 0 and ncmds > 0:
            now = time.monotonic()

            if self.buffer == None:
                self.buffer = self.conn.recv(remaining)
                self.bufferpos = 0

            # disconnected or error
            if self.buffer == None:
                return None

            for i in range(self.bufferpos, len(self.buffer)):
                c = self.buffer[i]
                self.bufferpos += 1
                if c == self.MSGBEGIN:
                    self.cmdpos = 0
                    self.parampos = 0
                    self.reading_cmd = True
                    self.reading_param = False
                elif c == self.MSGEND:
                    if not self.reading_cmd:
                        continue
                    self.reading_cmd = False
                    self.reading_param = False

                    cmd = self.cmd[0:self.cmdpos]
                    param = self.param[0:self.parampos]
                    self.reading_cmd = False
                    self.reading_param = False

                    parsed.append((cmd, param))
                    ncmds -= 1
                    if ncmds == 0:
                        break
                elif c == self.MSGSEP:
                    if self.reading_cmd:
                        self.reading_param = True
                else:
                    if self.reading_param:
                        self.param[self.parampos] = c
                        self.parampos += 1
                    elif self.reading_cmd:
                        self.cmd[self.cmdpos] = c
                        self.cmdpos += 1

            # if we read the entire buffer and didn't finish the command,
            # throw it away
            self.buffer = None

            # check if we have time for another iteration
            elapsed = time.monotonic() - now
            remaining = max(0, remaining - elapsed)

        # timeout
        return parsed

def control(args):
    if args.socket:
        address = '\0' + args.socket
    else:
        address = DEFAULT_SERVER_ADDRESS

    conn = Connection(address)
    msgparser = MsgParser(conn)

    version = None
    name = None
    mangohud_version = None

    msgs = msgparser.readCmd(3)

    for m in msgs:
        cmd, param = m
        if cmd == VERSION_HEADER:
            version = int(param)
        elif cmd == DEVICE_NAME_HEADER:
            name = param.decode('utf-8')
        elif cmd == MANGOHUD_VERSION_HEADER:
            mangohud_version = param.decode('utf-8')

    if args.info:
        info = "Protocol Version: {}\n"
        info += "Device Name: {}\n"
        info += "MangoHud Version: {}"
        print(info.format(version, name, mangohud_version))


    if args.cmd == 'toggle-logging':
        conn.send(bytearray(':logging;', 'utf-8'))
    elif args.cmd == 'start-logging':
        conn.send(bytearray(':logging=1;', 'utf-8'))

    elif args.cmd == 'stop-logging':
        conn.send(bytearray(':logging=0;', 'utf-8'))
        now = time.monotonic()
        while True:
            msg = str(conn.recv(3))
            if "LoggingFinished" in msg:
                print("Logging has stopped")
                exit(0)
            elapsed = time.monotonic() - now
            if elapsed > 3:
                print("Stop logging timed out")
                exit(1)

    elif args.cmd == 'toggle-hud':
        conn.send(bytearray(':hud;', 'utf-8'))
    elif args.cmd == 'toggle-fcat':
        conn.send(bytearray(':fcat;', 'utf-8'))

def main():
    parser = argparse.ArgumentParser(description='MangoHud control client')
    parser.add_argument('--info', action='store_true', help='Print info from socket')
    parser.add_argument('--socket', '-s', type=str, help='Path to socket')

    commands = parser.add_subparsers(help='commands to run', dest='cmd')
    commands.add_parser('toggle-hud')
    commands.add_parser('toggle-logging')
    commands.add_parser('start-logging')
    commands.add_parser('stop-logging')
    commands.add_parser('toggle-fcat')

    args = parser.parse_args()

    control(args)

if __name__ == '__main__':
    main()


================================================
FILE: data/MangoHud.conf
================================================
### MangoHud configuration file
### Uncomment any options you wish to enable. Default options are left uncommented
### Use some_parameter=0 to disable a parameter (only works with on/off parameters)
### Everything below can be used / overridden with the environment variable MANGOHUD_CONFIG instead

################ INFORMATIONAL #################
## prints possible options on stdout
# help

################ PERFORMANCE #################

### Limit the application FPS. Comma-separated list of one or more FPS values (e.g. 0,30,60). 0 means unlimited (unless VSynced)
# fps_limit=0

### early = wait before present, late = wait after present
# fps_limit_method=

### Vulkan Present Mode. Overrides application present mode. Takes precedence over `vsync=`.
# Present Modes:
#   immediate
#   mailbox
#   fifo
#   fifo_relaxed
#   shared_demand_refresh
#   shared_continuous_refresh
#   fifo_latest_ready
# Present Modes Documentation:
#   https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkPresentModeKHR.html
# vulkan_present_mode=mailbox

### VSync [0-3] 0 = adaptive; 1 = off; 2 = mailbox; 3 = on
# vsync=-1

### OpenGL VSync [0-N] 0 = off; >=1 = wait for N v-blanks, N > 1 acts as a FPS limiter (FPS = display refresh rate / N)
# gl_vsync=-2

### Mip-map LoD bias. Negative values will increase texture sharpness (and aliasing)
## Positive values will increase texture blurriness (-16 to 16)
# picmip=-17

### Anisotropic filtering level. Improves sharpness of textures viewed at an angle (0 to 16)
# af=-1

### Force bicubic filtering
# bicubic

### Force trilinear filtering
# trilinear

### Disable linear texture filtering. Makes textures look blocky
# retro

################### VISUAL ###################

### Legacy layout
# legacy_layout=0

### pre defined presets
# -1 = default
#  0 = no display
#  1 = fps only
#  2 = horizontal view
#  3 = extended
#  4 = high detailed information
# preset=-1

### Enable most of the toggleable parameters (currently excludes `histogram`)
# full

### Show FPS only. ***Not meant to be used with other display params***
# fps_only

### Display custom centered text, useful for a header
# custom_text_center=

### Display the current system time
# time
## removes the time label
# time_no_label

### Time formatting examples
## %H:%M
## [ %T %F ]
## %X # locally formatted time, because of limited glyph range, missing characters may show as '?' (e.g. Japanese)
# time_format="%T"

### Display MangoHud version
# version

### Display the current GPU information
## Note: gpu_mem_clock and gpu_mem_temp also need "vram" to be enabled
gpu_stats
# gpu_temp
# gpu_junction_temp
# gpu_core_clock
# gpu_mem_temp
# gpu_mem_clock
# gpu_power
# gpu_power_limit
# gpu_text=
# gpu_load_change
# gpu_load_value=60,90
# gpu_load_color=39F900,FDFD09,B22222
## GPU fan in rpm on AMD, FAN in percent on NVIDIA
# gpu_fan
## gpu_voltage only works on AMD GPUs
# gpu_voltage
## Select list of GPUs to display
# gpu_list=0,1
# gpu_efficiency

### Display the current CPU information
cpu_stats
# cpu_temp
# cpu_power
# cpu_text=
# cpu_mhz
# cpu_load_change
# cpu_load_value=60,90
# cpu_load_color=39F900,FDFD09,B22222
# cpu_efficiency

### Display the current CPU load & frequency for each core
# core_load
# core_load_change
# core_bars
# core_type

### Display IO read and write for the app (not system)
# io_read
# io_write

### Display system vram / ram / swap space usage
# vram
# ram
# swap

### Display per process memory usage
## Show resident memory and other types, if enabled
# procmem
# procmem_shared
# procmem_virt
# proc_vram

### Display battery information
# battery
# battery_icon
# device_battery=gamepad,mouse
# device_battery_icon
# battery_watt
# battery_time

### Display FPS and frametime
fps
# fps_sampling_period=500
# fps_color_change
# fps_value=30,60
# fps_color=B22222,FDFD09,39F900
# fps_text=""
frametime
# frame_count
## fps_metrics takes a list of decimal values or the value avg
# fps_metrics=avg,0.01

### Display GPU throttling status based on Power, current, temp or "other"
## Only shows if throttling is currently happening
throttling_status
## Same as throttling_status but displays throttling on the frametime graph
#throttling_status_graph

### Display miscellaneous information
# engine_version
# engine_short_names
# gpu_name
# vulkan_driver
# wine
# exec_name
# winesync
# present_mode

### Display loaded MangoHud architecture
# arch

### Display the frametime line graph
frame_timing
# frame_timing_detailed
# dynamic_frame_timing
# histogram

### Display GameMode / vkBasalt running status
# gamemode
# vkbasalt

### Gamescope related options
## Display the status of FSR (only works in gamescope)
# fsr
## Hides the sharpness info for the `fsr` option (only available in gamescope)
# hide_fsr_sharpness
## Shows the graph of gamescope app frametimes and latency (only on gamescope obviously)
# debug
## Display the status of HDR (only works in gamescope)
# hdr
## Display the current refresh rate (only works in gamescope)
# refresh_rate


### graphs displays one or more graphs that you chose
## separated by ",", available graphs are
## gpu_load,cpu_load,gpu_core_clock,gpu_mem_clock,vram,ram,cpu_temp,gpu_temp
# graphs=

### mangoapp related options
## Enables mangoapp to be displayed above the Steam UI
# mangoapp_steam

### Steam Deck options
## Shows the Steam Deck fan rpm
# fan

### Display current FPS limit
# show_fps_limit

### Display the current resolution
# resolution

### Display current display session
# display_server

### Display temperature in fahrenheit
# temp_fahrenheit

## Display efficiency in joules per frame
# flip_efficiency

### Display custom text
# custom_text=
### Display output of Bash command in next column
# exec=

### Display media player metadata
# media_player
## for example spotify
# media_player_name=
## Format metadata, lines are delimited by ; (wip)
## example: {title};{artist};{album}
## example: Track:;{title};By:;{artist};From:;{album}
# media_player_format=title,artist,album

### Network interface throughput
# network
## Network can take arguments but it's not required.
## without arguments it shows all interfaces
## arguments set which interfaces will be displayed
# network=eth0,wlo1


### Change the hud font size
# font_size=24
# font_scale=1.0
# font_size_text=24
# font_scale_media_player=0.55
# no_small_font

### Change default font (set location to TTF/OTF file)
## Set font for the whole hud
# font_file=

## Set font only for text like media player metadata
# font_file_text=

## Set font glyph ranges. Defaults to Latin-only. Don't forget to set font_file/font_file_text to font that supports these
## Probably don't enable all at once because of memory usage and hardware limits concerns
## If you experience crashes or text is just squares, reduce glyph range or reduce font size
# font_glyph_ranges=korean,chinese,chinese_simplified,japanese,cyrillic,thai,vietnamese,latin_ext_a,latin_ext_b

### Outline text
text_outline
# text_outline_color = 000000
# text_outline_thickness = 1.5

### Change the hud position
# position=top-left

### Change the corner roundness
# round_corners=0

### Remove margins around MangoHud
# hud_no_margin

### Display compact version of MangoHud
# hud_compact

### Display MangoHud in a horizontal position
# horizontal
# horizontal_stretch

### Disable / hide the hud by default
# no_display

### Show FEX-Emu statistics
## Only useful for Arm64 devices running applications under emulation
# fex_stats

### Hud position offset
# offset_x=0
# offset_y=0

### Hud dimensions
# width=0
# height=140
# table_columns=3
# cellpadding_y=-0.085

### Hud transparency / alpha
# background_alpha=0.5
# alpha=1.0

### FCAT overlay
### This enables an FCAT overlay to perform frametime analysis on the final image stream.
### Enable the overlay
# fcat
### Set the width of the FCAT overlay.
### 24 is a performance optimization on AMD GPUs that should not have adverse effects on nVidia GPUs.
### A minimum of 20 pixels is recommended by nVidia.
# fcat_overlay_width=24
### Set the screen edge, this can be useful for special displays that don't update from top edge to bottom. This goes from 0 (left side) to 3 (top edge), counter-clockwise.
# fcat_screen_edge=0

### Color customization
# text_color=FFFFFF
# gpu_color=2E9762
# cpu_color=2E97CB
# vram_color=AD64C1
# ram_color=C26693
# engine_color=EB5B5B
# io_color=A491D3
# frametime_color=00FF00
# background_color=020202
# media_player_color=FFFFFF
# wine_color=EB5B5B
# battery_color=FF9078
# network_color=E07B85
# horizontal_separator_color=AD64C1

### Specify GPU with PCI bus ID
### Set to 'domain:bus:slot.function'
### Example:
###     $ lspci | grep A770
###     03:00.0 VGA compatible controller: Intel Corporation DG2 [Arc A770] (rev 08)
# pci_dev=0000:03:00.0

### Blacklist
# blacklist=

### Control over socket
### Enable and set socket name, '%p' is replaced with process id
## example: mangohud
## example: mangohud-%p
# control = -1

### ftrace tracepoint display
## Enable display of tracepoint information gathered from ftrace. MangoHud will parse
## out the necessary data from the ftrace pipe, ftrace itself still has to be configured
## manually (enabling the desired event, applying any filtering etc.). The user running
## MangoHud will require permission to access the default-mounted tracefs (expected at
## /sys/kernel/tracing/).
##
## When parsing ftrace output, currently only the `key=value` format for event fields is
## expected. This is the most common format used in events, but it's not standardized.
##
## Three types of display are available:
## - `histogram/drm_vblank_event`, a histogram of event occurrence
## - `linegraph/devfreq_monitor/freq`, a line graph of an event field's numerical value
## - `label/devfreq_frequency/dev_name`, a textual presentation of an event field's value
##
## The displays are set through the `ftrace` option. Multiple displays can be specified.
# ftrace=histogram/drm_vblank_event+linegraph/devfreq_monitor/freq

################ WORKAROUNDS #################
### Options starting with "gl_*" are for OpenGL
### Specify what to use for getting display size. Options are "viewport", "scissorbox" or disabled. Defaults to using glXQueryDrawable
# gl_size_query=viewport

### (Re)bind given framebuffer before MangoHud gets drawn. Helps with Crusader Kings III
# gl_bind_framebuffer=0

### Don't swap origin if using GL_UPPER_LEFT. Helps with Ryujinx
# gl_dont_flip=1

################ INTERACTION #################

### Change toggle keybinds for the hud & logging
# toggle_hud=Shift_R+F12
# toggle_hud_position=Shift_R+F11
# toggle_preset=Shift_R+F10
# toggle_fps_limit=Shift_L+F1
# toggle_logging=Shift_L+F2
# reload_cfg=Shift_L+F4
# upload_log=Shift_L+F3
# reset_fps_metrics=Shift_R+f9

#################### LOG #####################
### Automatically start the log after X seconds
# autostart_log=
### Set amount of time in seconds that the logging will run for
# log_duration=
### Change the default log interval, 0 is default
# log_interval=0
### Set location of the output files (required for logging)
# output_folder=/home/<USERNAME>/mangologs
### Permit uploading logs directly to FlightlessMango.com
## set to 1 to enable
# permit_upload=0
### Define a '+'-separated list of percentiles shown in the benchmark results
### Use "AVG" to get a mean average. Default percentiles are 97+AVG+1+0.1
## example: ['97', 'AVG', '1', '0.1']
# benchmark_percentiles=97,AVG
## Adds more headers and information such as versioning to the log. This format is not supported on flightlessmango.com (yet)
# log_versioning
## Enable automatic uploads of logs to flightlessmango.com
# upload_logs
# output_file=""


================================================
FILE: data/io.github.flightlessmango.mangohud.metainfo.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<component type="generic">
  <id>io.github.flightlessmango.mangohud</id>

  <name>MangoHud</name>
  <summary>Vulkan/OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more</summary>
  <developer_name>FlightlessMango</developer_name>
  <icon type="stock">io.github.flightlessmango.mangohud</icon>

  <metadata_license>CC0-1.0</metadata_license>
  <project_license>MIT</project_license>

  <description>
    <p>A modification of the Mesa Vulkan overlay, including GUI improvements with HUD configuration, temperature reporting, and logging capabilities. Includes a script (mangohud) to start it on any OpenGL or Vulkan application.</p>
  </description>

  <screenshots>
    <screenshot type="default">
      <caption>Example</caption>
      <image>https://raw.githubusercontent.com/flightlessmango/MangoHud/master/assets/overlay_example.gif</image>
    </screenshot>
    <screenshot>
      <caption>Log uploading walkthrough</caption>
      <image>https://raw.githubusercontent.com/flightlessmango/MangoHud/master/assets/log_upload_example.gif</image>
    </screenshot>
  </screenshots>

  <url type="homepage">https://github.com/flightlessmango/MangoHud</url>
  <url type="bugtracker">https://github.com/flightlessmango/MangoHud/issues</url>
  <url type="donation">https://www.paypal.me/flightlessmango</url>

  <provides>
    <binary>mangohud</binary>
  </provides>

  <categories>
    <category>Utility</category>
    <category>Game</category>
  </categories>

  <content_rating type="oars-1.1" />
</component>


================================================
FILE: data/mangoapp.1
================================================
.\" Manpage for mangoapp.
.TH mangoapp 1 "" "" "mangoapp"

.SH NAME
mangoapp \- transparent background application with a built in mangohud

.SH SYNOPSIS
\fBmangoapp\fR

.SH DESCRIPTION
MangoHud is a Vulkan/OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more.
.PP
Mangoapp is a transparent background opengl application with a built in MangoHud. It's designed to be run inside a
gamescope instance which will display mangoapp ontop of gamescopes output. It also takes frame information from
gamescope. The purpose of this is to "easily" make MangoHud compatible with any application, or at least any
application that gamescope can run. This solves issues with some OpenGL games and certain ports that have stdc++ issues
as it's no longer directly injected into the game.

.SH USAGE
Create a script (e.g. \fBrun.sh\fR) containing the app you want to run (e.g. \fBvkcube\fR) and \fBmangoapp\fR like so:
.PP
.RS 4
.EX
#!/bin/sh

vkcube&
mangoapp
.EE
.RE
.PP
And then run it with \fBgamescope ./run.sh\fR.

.SH SEE ALSO
mangohud(1)

.SH ABOUT
MangoHud development takes place at \fIhttps://github.com/flightlessmango/MangoHud\fR.
.br
Benchmarks created with MangoHud can be uploaded to \fIhttps://flightlessmango.com\fR.


================================================
FILE: data/mangohud.1
================================================
.\" Manpage for mangohud.
.TH mangohud 1 "" "" "mangohud"

.SH NAME
mangohud \- enable MangoHud on any application

.SH SYNOPSIS
\fBmangohud\fR [--dlsym] COMMAND

.SH DESCRIPTION
MangoHud is a Vulkan/OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more.

.SH USAGE
MangoHud can be enabled for Vulkan applications by setting \fBMANGOHUD=1\fR as environment variable.
.br
To load MangoHud for any application, including OpenGL applications, the \fBmangohud\fR executable can be used. It preloads a library via ld into the application.
.br
Note: some OpenGL applications may also need dlsym hooking. This can be done by passing option \fB--dlsym\fR or by setting \fBMANGOHUD_DLSYM=1\fR as environment variable.

.SH CONFIG
MangoHud comes with a config file which can be used to set configuration options globally or per application. The priorities of different config files are:
.LP
.RS 4
/path/to/application/MangoHud.conf
.br
$XDG_CONFIG_HOME/MangoHud/{application_name}.conf
.br
$XDG_CONFIG_HOME/MangoHud/MangoHud.conf
.RS -4
.LP
An example config file is located in /usr/share/doc/mangohud/MangoHud.conf, containing all available options.
.LP
A custom config file location can also be specified with the \fBMANGOHUD_CONFIGFILE\fR environment variable.
.br
Config options can also be set with the \fBMANGOHUD_CONFIG\fR environment variable. This takes priority over any config file.

.SH EXAMPLES
OpenGL: \fBmangohud glxgears\fR
.br
Vulkan: \fBMANGOHUD=1 vkcube\fR
.br
Steam: set your launch option to \fBmangohud %command%\fR
.br
Lutris: add \fBmangohud\fR to the Command prefix setting
.br
OpenGL with dlsym: \fBmangohud --dlsym glxgears\fR
.br
Custom config options: \fBMANGOHUD_CONFIG="gpu_stats=0,font_size=12" mangohud glxgears\fR

.SH ABOUT
MangoHud development takes place at \fIhttps://github.com/flightlessmango/MangoHud\fR.
.br
Benchmarks created with MangoHud can be uploaded to \fIhttps://flightlessmango.com\fR.


================================================
FILE: data/meson.build
================================================
man1dir = join_paths(get_option('mandir'), 'man1')
datadir = get_option('datadir')
metainfo_file = files('io.github.flightlessmango.mangohud.metainfo.xml')
icon_file = files('io.github.flightlessmango.mangohud.svg')

# Validate metainfo file
ascli_exe = find_program('appstreamcli', required: get_option('tests'))
if ascli_exe.found()
  test('validate metainfo file',
       ascli_exe,
       args: ['validate',
              '--no-net',
              '--pedantic',
              metainfo_file]
  )
endif

# Install metainfo file
install_data(
  metainfo_file,
  install_dir: join_paths(datadir, 'metainfo'),
  install_tag : 'doc',
)

# Install icon for metainfo
install_data(
  icon_file,
  install_dir: join_paths(datadir, 'icons', 'hicolor', 'scalable', 'apps'),
  install_tag : 'doc',
)

# Install man pages
install_man(
  files('mangohud.1'),
  install_dir: man1dir,
)
if get_option('mangoapp')
  install_man(
    files('mangoapp.1'),
    install_dir: man1dir,
  )
endif

install_data(
  files('MangoHud.conf'),
  install_dir : join_paths(get_option('datadir'), 'doc', 'mangohud'),
  rename : ['MangoHud.conf.example'],
  install_tag : 'doc',
)

install_data(
  files('presets.conf'),
  install_dir : join_paths(get_option('datadir'), 'doc', 'mangohud'),
  rename : ['presets.conf.example'],
  install_tag : 'doc',
)


================================================
FILE: data/presets.conf
================================================
[preset 1]
no_display

[preset 2]
legacy_layout=0
cpu_stats=0
gpu_stats=0
fps
fps_only=1
frametime=0


================================================
FILE: include/.editorconfig
================================================
# ignore this folder
root = true



================================================
FILE: include/IconsForkAwesome.h
================================================
// Generated by https://github.com/juliettef/IconFontCppHeaders script GenerateIconFontCppHeaders.py for languages C and C++
// from https://raw.githubusercontent.com/ForkAwesome/Fork-Awesome/master/src/icons/icons.yml
// for use with https://github.com/ForkAwesome/Fork-Awesome/blob/master/fonts/forkawesome-webfont.ttf
#pragma once

#define FONT_ICON_FILE_NAME_FK "forkawesome-webfont.ttf"

#define ICON_MIN_FK 0xf000
#define ICON_MAX_FK 0xf35f
#define ICON_FK_GLASS "\xef\x80\x80"	// U+f000
#define ICON_FK_MUSIC "\xef\x80\x81"	// U+f001
#define ICON_FK_SEARCH "\xef\x80\x82"	// U+f002
#define ICON_FK_ENVELOPE_O "\xef\x80\x83"	// U+f003
#define ICON_FK_HEART "\xef\x80\x84"	// U+f004
#define ICON_FK_STAR "\xef\x80\x85"	// U+f005
#define ICON_FK_STAR_O "\xef\x80\x86"	// U+f006
#define ICON_FK_USER "\xef\x80\x87"	// U+f007
#define ICON_FK_FILM "\xef\x80\x88"	// U+f008
#define ICON_FK_TH_LARGE "\xef\x80\x89"	// U+f009
#define ICON_FK_TH "\xef\x80\x8a"	// U+f00a
#define ICON_FK_TH_LIST "\xef\x80\x8b"	// U+f00b
#define ICON_FK_CHECK "\xef\x80\x8c"	// U+f00c
#define ICON_FK_TIMES "\xef\x80\x8d"	// U+f00d
#define ICON_FK_SEARCH_PLUS "\xef\x80\x8e"	// U+f00e
#define ICON_FK_SEARCH_MINUS "\xef\x80\x90"	// U+f010
#define ICON_FK_POWER_OFF "\xef\x80\x91"	// U+f011
#define ICON_FK_SIGNAL "\xef\x80\x92"	// U+f012
#define ICON_FK_COG "\xef\x80\x93"	// U+f013
#define ICON_FK_TRASH_O "\xef\x80\x94"	// U+f014
#define ICON_FK_HOME "\xef\x80\x95"	// U+f015
#define ICON_FK_FILE_O "\xef\x80\x96"	// U+f016
#define ICON_FK_CLOCK_O "\xef\x80\x97"	// U+f017
#define ICON_FK_ROAD "\xef\x80\x98"	// U+f018
#define ICON_FK_DOWNLOAD "\xef\x80\x99"	// U+f019
#define ICON_FK_ARROW_CIRCLE_O_DOWN "\xef\x80\x9a"	// U+f01a
#define ICON_FK_ARROW_CIRCLE_O_UP "\xef\x80\x9b"	// U+f01b
#define ICON_FK_INBOX "\xef\x80\x9c"	// U+f01c
#define ICON_FK_PLAY_CIRCLE_O "\xef\x80\x9d"	// U+f01d
#define ICON_FK_REPEAT "\xef\x80\x9e"	// U+f01e
#define ICON_FK_REFRESH "\xef\x80\xa1"	// U+f021
#define ICON_FK_LIST_ALT "\xef\x80\xa2"	// U+f022
#define ICON_FK_LOCK "\xef\x80\xa3"	// U+f023
#define ICON_FK_FLAG "\xef\x80\xa4"	// U+f024
#define ICON_FK_HEADPHONES "\xef\x80\xa5"	// U+f025
#define ICON_FK_VOLUME_OFF "\xef\x80\xa6"	// U+f026
#define ICON_FK_VOLUME_DOWN "\xef\x80\xa7"	// U+f027
#define ICON_FK_VOLUME_UP "\xef\x80\xa8"	// U+f028
#define ICON_FK_QRCODE "\xef\x80\xa9"	// U+f029
#define ICON_FK_BARCODE "\xef\x80\xaa"	// U+f02a
#define ICON_FK_TAG "\xef\x80\xab"	// U+f02b
#define ICON_FK_TAGS "\xef\x80\xac"	// U+f02c
#define ICON_FK_BOOK "\xef\x80\xad"	// U+f02d
#define ICON_FK_BOOKMARK "\xef\x80\xae"	// U+f02e
#define ICON_FK_PRINT "\xef\x80\xaf"	// U+f02f
#define ICON_FK_CAMERA "\xef\x80\xb0"	// U+f030
#define ICON_FK_FONT "\xef\x80\xb1"	// U+f031
#define ICON_FK_BOLD "\xef\x80\xb2"	// U+f032
#define ICON_FK_ITALIC "\xef\x80\xb3"	// U+f033
#define ICON_FK_TEXT_HEIGHT "\xef\x80\xb4"	// U+f034
#define ICON_FK_TEXT_WIDTH "\xef\x80\xb5"	// U+f035
#define ICON_FK_ALIGN_LEFT "\xef\x80\xb6"	// U+f036
#define ICON_FK_ALIGN_CENTER "\xef\x80\xb7"	// U+f037
#define ICON_FK_ALIGN_RIGHT "\xef\x80\xb8"	// U+f038
#define ICON_FK_ALIGN_JUSTIFY "\xef\x80\xb9"	// U+f039
#define ICON_FK_LIST "\xef\x80\xba"	// U+f03a
#define ICON_FK_OUTDENT "\xef\x80\xbb"	// U+f03b
#define ICON_FK_INDENT "\xef\x80\xbc"	// U+f03c
#define ICON_FK_VIDEO_CAMERA "\xef\x80\xbd"	// U+f03d
#define ICON_FK_PICTURE_O "\xef\x80\xbe"	// U+f03e
#define ICON_FK_PENCIL "\xef\x81\x80"	// U+f040
#define ICON_FK_MAP_MARKER "\xef\x81\x81"	// U+f041
#define ICON_FK_ADJUST "\xef\x81\x82"	// U+f042
#define ICON_FK_TINT "\xef\x81\x83"	// U+f043
#define ICON_FK_PENCIL_SQUARE_O "\xef\x81\x84"	// U+f044
#define ICON_FK_SHARE_SQUARE_O "\xef\x81\x85"	// U+f045
#define ICON_FK_CHECK_SQUARE_O "\xef\x81\x86"	// U+f046
#define ICON_FK_ARROWS "\xef\x81\x87"	// U+f047
#define ICON_FK_STEP_BACKWARD "\xef\x81\x88"	// U+f048
#define ICON_FK_FAST_BACKWARD "\xef\x81\x89"	// U+f049
#define ICON_FK_BACKWARD "\xef\x81\x8a"	// U+f04a
#define ICON_FK_PLAY "\xef\x81\x8b"	// U+f04b
#define ICON_FK_PAUSE "\xef\x81\x8c"	// U+f04c
#define ICON_FK_STOP "\xef\x81\x8d"	// U+f04d
#define ICON_FK_FORWARD "\xef\x81\x8e"	// U+f04e
#define ICON_FK_FAST_FORWARD "\xef\x81\x90"	// U+f050
#define ICON_FK_STEP_FORWARD "\xef\x81\x91"	// U+f051
#define ICON_FK_EJECT "\xef\x81\x92"	// U+f052
#define ICON_FK_CHEVRON_LEFT "\xef\x81\x93"	// U+f053
#define ICON_FK_CHEVRON_RIGHT "\xef\x81\x94"	// U+f054
#define ICON_FK_PLUS_CIRCLE "\xef\x81\x95"	// U+f055
#define ICON_FK_MINUS_CIRCLE "\xef\x81\x96"	// U+f056
#define ICON_FK_TIMES_CIRCLE "\xef\x81\x97"	// U+f057
#define ICON_FK_CHECK_CIRCLE "\xef\x81\x98"	// U+f058
#define ICON_FK_QUESTION_CIRCLE "\xef\x81\x99"	// U+f059
#define ICON_FK_INFO_CIRCLE "\xef\x81\x9a"	// U+f05a
#define ICON_FK_CROSSHAIRS "\xef\x81\x9b"	// U+f05b
#define ICON_FK_TIMES_CIRCLE_O "\xef\x81\x9c"	// U+f05c
#define ICON_FK_CHECK_CIRCLE_O "\xef\x81\x9d"	// U+f05d
#define ICON_FK_BAN "\xef\x81\x9e"	// U+f05e
#define ICON_FK_ARROW_LEFT "\xef\x81\xa0"	// U+f060
#define ICON_FK_ARROW_RIGHT "\xef\x81\xa1"	// U+f061
#define ICON_FK_ARROW_UP "\xef\x81\xa2"	// U+f062
#define ICON_FK_ARROW_DOWN "\xef\x81\xa3"	// U+f063
#define ICON_FK_SHARE "\xef\x81\xa4"	// U+f064
#define ICON_FK_EXPAND "\xef\x81\xa5"	// U+f065
#define ICON_FK_COMPRESS "\xef\x81\xa6"	// U+f066
#define ICON_FK_PLUS "\xef\x81\xa7"	// U+f067
#define ICON_FK_MINUS "\xef\x81\xa8"	// U+f068
#define ICON_FK_ASTERISK "\xef\x81\xa9"	// U+f069
#define ICON_FK_EXCLAMATION_CIRCLE "\xef\x81\xaa"	// U+f06a
#define ICON_FK_GIFT "\xef\x81\xab"	// U+f06b
#define ICON_FK_LEAF "\xef\x81\xac"	// U+f06c
#define ICON_FK_FIRE "\xef\x81\xad"	// U+f06d
#define ICON_FK_EYE "\xef\x81\xae"	// U+f06e
#define ICON_FK_EYE_SLASH "\xef\x81\xb0"	// U+f070
#define ICON_FK_EXCLAMATION_TRIANGLE "\xef\x81\xb1"	// U+f071
#define ICON_FK_PLANE "\xef\x81\xb2"	// U+f072
#define ICON_FK_CALENDAR "\xef\x81\xb3"	// U+f073
#define ICON_FK_RANDOM "\xef\x81\xb4"	// U+f074
#define ICON_FK_COMMENT "\xef\x81\xb5"	// U+f075
#define ICON_FK_MAGNET "\xef\x81\xb6"	// U+f076
#define ICON_FK_CHEVRON_UP "\xef\x81\xb7"	// U+f077
#define ICON_FK_CHEVRON_DOWN "\xef\x81\xb8"	// U+f078
#define ICON_FK_RETWEET "\xef\x81\xb9"	// U+f079
#define ICON_FK_SHOPPING_CART "\xef\x81\xba"	// U+f07a
#define ICON_FK_FOLDER "\xef\x81\xbb"	// U+f07b
#define ICON_FK_FOLDER_OPEN "\xef\x81\xbc"	// U+f07c
#define ICON_FK_ARROWS_V "\xef\x81\xbd"	// U+f07d
#define ICON_FK_ARROWS_H "\xef\x81\xbe"	// U+f07e
#define ICON_FK_BAR_CHART "\xef\x82\x80"	// U+f080
#define ICON_FK_TWITTER_SQUARE "\xef\x82\x81"	// U+f081
#define ICON_FK_FACEBOOK_SQUARE "\xef\x82\x82"	// U+f082
#define ICON_FK_CAMERA_RETRO "\xef\x82\x83"	// U+f083
#define ICON_FK_KEY "\xef\x82\x84"	// U+f084
#define ICON_FK_COGS "\xef\x82\x85"	// U+f085
#define ICON_FK_COMMENTS "\xef\x82\x86"	// U+f086
#define ICON_FK_THUMBS_O_UP "\xef\x82\x87"	// U+f087
#define ICON_FK_THUMBS_O_DOWN "\xef\x82\x88"	// U+f088
#define ICON_FK_STAR_HALF "\xef\x82\x89"	// U+f089
#define ICON_FK_HEART_O "\xef\x82\x8a"	// U+f08a
#define ICON_FK_SIGN_OUT "\xef\x82\x8b"	// U+f08b
#define ICON_FK_LINKEDIN_SQUARE "\xef\x82\x8c"	// U+f08c
#define ICON_FK_THUMB_TACK "\xef\x82\x8d"	// U+f08d
#define ICON_FK_EXTERNAL_LINK "\xef\x82\x8e"	// U+f08e
#define ICON_FK_SIGN_IN "\xef\x82\x90"	// U+f090
#define ICON_FK_TROPHY "\xef\x82\x91"	// U+f091
#define ICON_FK_GITHUB_SQUARE "\xef\x82\x92"	// U+f092
#define ICON_FK_UPLOAD "\xef\x82\x93"	// U+f093
#define ICON_FK_LEMON_O "\xef\x82\x94"	// U+f094
#define ICON_FK_PHONE "\xef\x82\x95"	// U+f095
#define ICON_FK_SQUARE_O "\xef\x82\x96"	// U+f096
#define ICON_FK_BOOKMARK_O "\xef\x82\x97"	// U+f097
#define ICON_FK_PHONE_SQUARE "\xef\x82\x98"	// U+f098
#define ICON_FK_TWITTER "\xef\x82\x99"	// U+f099
#define ICON_FK_FACEBOOK "\xef\x82\x9a"	// U+f09a
#define ICON_FK_GITHUB "\xef\x82\x9b"	// U+f09b
#define ICON_FK_UNLOCK "\xef\x82\x9c"	// U+f09c
#define ICON_FK_CREDIT_CARD "\xef\x82\x9d"	// U+f09d
#define ICON_FK_RSS "\xef\x82\x9e"	// U+f09e
#define ICON_FK_HDD_O "\xef\x82\xa0"	// U+f0a0
#define ICON_FK_BULLHORN "\xef\x82\xa1"	// U+f0a1
#define ICON_FK_BELL_O "\xef\x83\xb3"	// U+f0f3
#define ICON_FK_CERTIFICATE "\xef\x82\xa3"	// U+f0a3
#define ICON_FK_HAND_O_RIGHT "\xef\x82\xa4"	// U+f0a4
#define ICON_FK_HAND_O_LEFT "\xef\x82\xa5"	// U+f0a5
#define ICON_FK_HAND_O_UP "\xef\x82\xa6"	// U+f0a6
#define ICON_FK_HAND_O_DOWN "\xef\x82\xa7"	// U+f0a7
#define ICON_FK_ARROW_CIRCLE_LEFT "\xef\x82\xa8"	// U+f0a8
#define ICON_FK_ARROW_CIRCLE_RIGHT "\xef\x82\xa9"	// U+f0a9
#define ICON_FK_ARROW_CIRCLE_UP "\xef\x82\xaa"	// U+f0aa
#define ICON_FK_ARROW_CIRCLE_DOWN "\xef\x82\xab"	// U+f0ab
#define ICON_FK_GLOBE "\xef\x82\xac"	// U+
Download .txt
gitextract_zt6zshhe/

├── .editorconfig
├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   └── -bug-report----issue.md
│   ├── dependabot.yml
│   └── workflows/
│       ├── arch-package.yml
│       ├── build-package.yml
│       ├── build-source.yml
│       ├── mingw.yml
│       ├── param-check.yml
│       └── ubuntu.yml
├── .gitignore
├── .gitmodules
├── LICENSE
├── README.md
├── bin/
│   ├── gen_enum_to_str.py
│   ├── mangohud-setup.sh
│   ├── mangohud.in
│   ├── mangoplot.py
│   ├── meson.build
│   ├── vk_dispatch_table_gen.py
│   ├── vk_entrypoints.py
│   ├── vk_extensions.py
│   └── vk_extensions_gen.py
├── build-source.sh
├── build-srt.sh
├── build-with-srt-docker.sh
├── build.sh
├── build_deps.sh
├── control/
│   ├── setup.cfg
│   ├── setup.py
│   └── src/
│       └── control/
│           └── __init__.py
├── data/
│   ├── MangoHud.conf
│   ├── io.github.flightlessmango.mangohud.metainfo.xml
│   ├── mangoapp.1
│   ├── mangohud.1
│   ├── meson.build
│   └── presets.conf
├── include/
│   ├── .editorconfig
│   ├── IconsForkAwesome.h
│   ├── KHR/
│   │   └── khrplatform.h
│   ├── elfhacks.h
│   ├── filesystem.h
│   ├── glad/
│   │   └── glad.h
│   ├── nvml.h
│   └── vulkan/
│       └── vk_util.h
├── meson.build
├── meson_options.txt
├── mingw32.txt
├── mingw64.txt
├── pkgbuild/
│   └── PKGBUILD
├── src/
│   ├── amdgpu.cpp
│   ├── amdgpu.h
│   ├── app/
│   │   ├── control.c
│   │   ├── main.cpp
│   │   ├── mangoapp.h
│   │   └── mangoapp_proto.h
│   ├── battery.cpp
│   ├── battery.h
│   ├── blacklist.cpp
│   ├── blacklist.h
│   ├── config.cpp
│   ├── config.h
│   ├── control.cpp
│   ├── cpu.cpp
│   ├── cpu.h
│   ├── cpu_win32.cpp
│   ├── dbus.cpp
│   ├── dbus_helpers.h
│   ├── dbus_info.h
│   ├── device.cpp
│   ├── device.h
│   ├── elfhacks.c
│   ├── fcat.h
│   ├── fex.cpp
│   ├── fex.h
│   ├── file_utils.cpp
│   ├── file_utils.h
│   ├── file_utils_win32.cpp
│   ├── font.cpp
│   ├── font_default.h
│   ├── font_unispace.c
│   ├── forkawesome.h
│   ├── fps_limiter.h
│   ├── fps_metrics.h
│   ├── ftrace.cpp
│   ├── ftrace.h
│   ├── gl/
│   │   ├── gl.h
│   │   ├── gl_hud.cpp
│   │   ├── gl_hud.h
│   │   ├── gl_renderer.cpp
│   │   ├── gl_renderer.h
│   │   ├── glad.c
│   │   ├── inject_egl.cpp
│   │   ├── inject_glx.cpp
│   │   └── shim.c
│   ├── gpu.cpp
│   ├── gpu.h
│   ├── gpu_fdinfo.cpp
│   ├── gpu_fdinfo.h
│   ├── gpu_metrics_util.h
│   ├── hud_elements.cpp
│   ├── hud_elements.h
│   ├── imgui_utils.h
│   ├── iostats.cpp
│   ├── iostats.h
│   ├── keybinds.cpp
│   ├── keybinds.h
│   ├── loaders/
│   │   ├── loader_dbus.cpp
│   │   ├── loader_dbus.h
│   │   ├── loader_glx.cpp
│   │   ├── loader_glx.h
│   │   ├── loader_nvctrl.cpp
│   │   ├── loader_nvctrl.h
│   │   ├── loader_nvml.cpp
│   │   ├── loader_nvml.h
│   │   ├── loader_x11.cpp
│   │   └── loader_x11.h
│   ├── logging.cpp
│   ├── logging.h
│   ├── mangohud.json.in
│   ├── mangohud.version
│   ├── memory.cpp
│   ├── memory.h
│   ├── mesa/
│   │   ├── c11_compat.h
│   │   ├── c99_compat.h
│   │   ├── no_extern_c.h
│   │   └── util/
│   │       ├── detect_os.h
│   │       ├── macros.h
│   │       ├── os_socket.c
│   │       ├── os_socket.h
│   │       ├── os_time.c
│   │       └── os_time.h
│   ├── meson.build
│   ├── net.cpp
│   ├── net.h
│   ├── notify.cpp
│   ├── notify.h
│   ├── nvapi.cpp
│   ├── nvidia.cpp
│   ├── nvidia.h
│   ├── overlay.cpp
│   ├── overlay.frag
│   ├── overlay.h
│   ├── overlay.vert
│   ├── overlay_params.cpp
│   ├── overlay_params.h
│   ├── pci_ids.cpp
│   ├── pci_ids.h
│   ├── real_dlsym.c
│   ├── real_dlsym.h
│   ├── shared_x11.cpp
│   ├── shared_x11.h
│   ├── shell.cpp
│   ├── shell.h
│   ├── string_utils.h
│   ├── timing.hpp
│   ├── vulkan.cpp
│   ├── wayland_hook.h
│   ├── wayland_keybinds.cpp
│   ├── win/
│   │   ├── d3d11_hook.cpp
│   │   ├── d3d11_hook.h
│   │   ├── d3d12_hook.cpp
│   │   ├── d3d12_hook.h
│   │   ├── d3d_shared.cpp
│   │   ├── d3d_shared.h
│   │   ├── dxgi.cpp
│   │   ├── dxgi.h
│   │   ├── kiero.cpp
│   │   ├── kiero.h
│   │   ├── main.cpp
│   │   └── win_shared.h
│   └── winesync.h
├── steamrt.Dockerfile.in
├── subprojects/
│   ├── cmocka.wrap
│   ├── imgui.wrap
│   ├── implot.wrap
│   ├── minhook.wrap
│   ├── packagefiles/
│   │   ├── vulkan-headers/
│   │   │   └── meson.build
│   │   └── vulkan-utility-libraries/
│   │       └── meson.build
│   ├── spdlog.wrap
│   ├── vulkan-headers.wrap
│   └── vulkan-utility-libraries.wrap
├── tests/
│   ├── gpu_metrics
│   ├── gpu_metrics_apu
│   ├── gpu_metrics_invalid
│   ├── params.py
│   └── test_amdgpu.cpp
└── version.h.in
Download .txt
SYMBOL INDEX (1003 symbols across 106 files)

FILE: bin/gen_enum_to_str.py
  class NamedFactory (line 256) | class NamedFactory(object):
    method __init__ (line 259) | def __init__(self, type_):
    method __call__ (line 263) | def __call__(self, name, **kwargs):
    method get (line 270) | def get(self, name):
  class VkExtension (line 274) | class VkExtension(object):
    method __init__ (line 277) | def __init__(self, name, number=None, define=None):
  function CamelCase_to_SHOUT_CASE (line 283) | def CamelCase_to_SHOUT_CASE(s):
  function compute_max_enum_name (line 286) | def compute_max_enum_name(s):
  class VkEnum (line 302) | class VkEnum(object):
    method __init__ (line 305) | def __init__(self, name, bitwidth=32, values=None):
    method all_bits_name (line 316) | def all_bits_name(self):
    method all_bits_value (line 322) | def all_bits_value(self):
    method add_value (line 325) | def add_value(self, name, value=None,
    method add_value_from_xml (line 358) | def add_value_from_xml(self, elem, extension=None):
    method set_guard (line 379) | def set_guard(self, g):
  class VkChainStruct (line 383) | class VkChainStruct(object):
    method __init__ (line 385) | def __init__(self, name, stype):
  function struct_get_stype (line 391) | def struct_get_stype(xml_node):
  class VkObjectType (line 398) | class VkObjectType(object):
    method __init__ (line 400) | def __init__(self, name):
  function parse_xml (line 405) | def parse_xml(enum_factory, ext_factory, struct_factory, bitmask_factory,
  function main (line 529) | def main():

FILE: bin/mangoplot.py
  function identity (line 31) | def identity(val):
  function get_integer (line 38) | def get_integer(val: str) -> int:
  function is_integer (line 48) | def is_integer(s: str) -> bool:
  function get_float (line 59) | def get_float(val):
  function is_float (line 69) | def is_float(s: str) -> bool:
  class Database (line 80) | class Database:
    method __init__ (line 85) | def __init__(self,
    method load_from_folder (line 102) | def load_from_folder(self,
  class BenchmarkFile (line 128) | class BenchmarkFile:
    method __init__ (line 135) | def __init__(self,
    method __lt__ (line 157) | def __lt__(self, other):
    method set_variable (line 167) | def set_variable(self, name, value):
    method get_variable (line 175) | def get_variable(self, name):
    method _read_column_names (line 181) | def _read_column_names(self):
    method _load_data (line 215) | def _load_data(self):
    method get_column_names (line 250) | def get_column_names(self) -> List[str]:
    method get (line 257) | def get(self, col: str, data_type: str = "float") \

FILE: bin/vk_dispatch_table_gen.py
  class StringIntMapEntry (line 729) | class StringIntMapEntry:
    method __init__ (line 730) | def __init__(self, string, num):
  function round_to_pow2 (line 742) | def round_to_pow2(x):
  class StringIntMap (line 745) | class StringIntMap:
    method __init__ (line 746) | def __init__(self):
    method add_string (line 750) | def add_string(self, string, num):
    method bake (line 756) | def bake(self):
  function main (line 781) | def main():

FILE: bin/vk_entrypoints.py
  class EntrypointBase (line 33) | class EntrypointBase:
    method __init__ (line 34) | def __init__(self, name):
    method prefixed_name (line 44) | def prefixed_name(self, prefix):
  class Entrypoint (line 47) | class Entrypoint(EntrypointBase):
    method __init__ (line 48) | def __init__(self, name, return_type, params):
    method is_physical_device_entrypoint (line 56) | def is_physical_device_entrypoint(self):
    method is_device_entrypoint (line 59) | def is_device_entrypoint(self):
    method decl_params (line 62) | def decl_params(self, start=0):
    method call_params (line 65) | def call_params(self, start=0):
  class EntrypointAlias (line 68) | class EntrypointAlias(EntrypointBase):
    method __init__ (line 69) | def __init__(self, name, entrypoint):
    method is_physical_device_entrypoint (line 74) | def is_physical_device_entrypoint(self):
    method is_device_entrypoint (line 77) | def is_device_entrypoint(self):
    method prefixed_name (line 80) | def prefixed_name(self, prefix):
    method params (line 84) | def params(self):
    method return_type (line 88) | def return_type(self):
    method disp_table_index (line 92) | def disp_table_index(self):
    method decl_params (line 95) | def decl_params(self):
    method call_params (line 98) | def call_params(self):
  function get_entrypoints (line 101) | def get_entrypoints(doc, api, beta):
  function get_entrypoints_from_xml (line 140) | def get_entrypoints_from_xml(xml_files, beta, api='vulkan'):

FILE: bin/vk_extensions.py
  function get_api_list (line 5) | def get_api_list(s):
  class Extension (line 14) | class Extension:
    method __init__ (line 15) | def __init__(self, name, number, ext_version):
    method from_xml (line 24) | def from_xml(ext_elem):
    method c_android_condition (line 52) | def c_android_condition(self):
  class ApiVersion (line 63) | class ApiVersion:
    method __init__ (line 64) | def __init__(self, version):
  class VkVersion (line 67) | class VkVersion:
    method __init__ (line 68) | def __init__(self, string):
    method __str__ (line 84) | def __str__(self):
    method c_vk_version (line 90) | def c_vk_version(self):
    method __int_ver (line 94) | def __int_ver(self):
    method __gt__ (line 98) | def __gt__(self, other):
    method __le__ (line 107) | def __le__(self, other):
  function extension_order (line 113) | def extension_order(ext):
  function get_all_exts_from_xml (line 126) | def get_all_exts_from_xml(xml, api='vulkan'):
  function init_exts_from_xml (line 139) | def init_exts_from_xml(xml, extensions, platform_defines):
  class Requirements (line 161) | class Requirements:
    method __init__ (line 162) | def __init__(self, core_version=None):
    method add_extension (line 167) | def add_extension(self, ext):
  function filter_api (line 175) | def filter_api(elem, api):
  function get_alias (line 181) | def get_alias(aliases, name):
  function get_all_required (line 187) | def get_all_required(xml, thing, api, beta):

FILE: bin/vk_extensions_gen.py
  function gen_extensions (line 111) | def gen_extensions(xml_files, extensions, out_c, out_h):
  function main (line 134) | def main():

FILE: control/src/control/__init__.py
  class Connection (line 19) | class Connection:
    method __init__ (line 20) | def __init__(self, path):
    method recv (line 36) | def recv(self, timeout):
    method send (line 65) | def send(self, msg):
  class MsgParser (line 68) | class MsgParser:
    method __init__ (line 73) | def __init__(self, conn):
    method readCmd (line 85) | def readCmd(self, ncmds, timeout=TIMEOUT):
  function control (line 152) | def control(args):
  function main (line 206) | def main():

FILE: include/KHR/khrplatform.h
  type khronos_int32_t (line 150) | typedef int32_t                 khronos_int32_t;
  type khronos_uint32_t (line 151) | typedef uint32_t                khronos_uint32_t;
  type khronos_int64_t (line 152) | typedef int64_t                 khronos_int64_t;
  type khronos_uint64_t (line 153) | typedef uint64_t                khronos_uint64_t;
  type khronos_int32_t (line 163) | typedef int32_t                 khronos_int32_t;
  type khronos_uint32_t (line 164) | typedef uint32_t                khronos_uint32_t;
  type khronos_int64_t (line 165) | typedef int64_t                 khronos_int64_t;
  type khronos_uint64_t (line 166) | typedef uint64_t                khronos_uint64_t;
  type __int32 (line 175) | typedef __int32                 khronos_int32_t;
  type khronos_uint32_t (line 176) | typedef unsigned __int32        khronos_uint32_t;
  type __int64 (line 177) | typedef __int64                 khronos_int64_t;
  type khronos_uint64_t (line 178) | typedef unsigned __int64        khronos_uint64_t;
  type khronos_int32_t (line 187) | typedef int                     khronos_int32_t;
  type khronos_uint32_t (line 188) | typedef unsigned int            khronos_uint32_t;
  type khronos_int64_t (line 190) | typedef long int                khronos_int64_t;
  type khronos_uint64_t (line 191) | typedef unsigned long int       khronos_uint64_t;
  type khronos_int64_t (line 193) | typedef long long int           khronos_int64_t;
  type khronos_uint64_t (line 194) | typedef unsigned long long int  khronos_uint64_t;
  type khronos_int32_t (line 204) | typedef int                     khronos_int32_t;
  type khronos_uint32_t (line 205) | typedef unsigned int            khronos_uint32_t;
  type khronos_int32_t (line 215) | typedef int32_t                 khronos_int32_t;
  type khronos_uint32_t (line 216) | typedef uint32_t                khronos_uint32_t;
  type khronos_int64_t (line 217) | typedef int64_t                 khronos_int64_t;
  type khronos_uint64_t (line 218) | typedef uint64_t                khronos_uint64_t;
  type khronos_int8_t (line 228) | typedef signed   char          khronos_int8_t;
  type khronos_uint8_t (line 229) | typedef unsigned char          khronos_uint8_t;
  type khronos_int16_t (line 230) | typedef signed   short int     khronos_int16_t;
  type khronos_uint16_t (line 231) | typedef unsigned short int     khronos_uint16_t;
  type khronos_intptr_t (line 239) | typedef signed   long long int khronos_intptr_t;
  type khronos_uintptr_t (line 240) | typedef unsigned long long int khronos_uintptr_t;
  type khronos_ssize_t (line 241) | typedef signed   long long int khronos_ssize_t;
  type khronos_usize_t (line 242) | typedef unsigned long long int khronos_usize_t;
  type khronos_intptr_t (line 244) | typedef signed   long  int     khronos_intptr_t;
  type khronos_uintptr_t (line 245) | typedef unsigned long  int     khronos_uintptr_t;
  type khronos_ssize_t (line 246) | typedef signed   long  int     khronos_ssize_t;
  type khronos_usize_t (line 247) | typedef unsigned long  int     khronos_usize_t;
  type khronos_float_t (line 254) | typedef          float         khronos_float_t;
  type khronos_uint64_t (line 267) | typedef khronos_uint64_t       khronos_utime_nanoseconds_t;
  type khronos_int64_t (line 268) | typedef khronos_int64_t        khronos_stime_nanoseconds_t;
  type khronos_boolean_enum_t (line 284) | typedef enum {

FILE: include/elfhacks.h
  type eh_obj_t (line 71) | typedef struct {
  type eh_sym_t (line 95) | typedef struct {
  type eh_rel_t (line 107) | typedef struct {

FILE: include/filesystem.h
  function namespace (line 349) | namespace detail {
  function private (line 360) | private path_helper_base<std::wstring::value_type>
  function string_type (line 480) | const string_type& native() const noexcept;
  function string_type (line 590) | static const string_type::size_type _prefixLength{0}
  function string_type (line 593) | static const string_type::size_type _prefixLength{0};
  function path (line 636) | const path& path1() const noexcept;
  type space_info (line 679) | struct space_info
  function file_type (line 687) | enum class file_type {
  function GHC_INLINE (line 2644) | GHC_INLINE const path::string_type& path::native() const noexcept
  function namespace (line 2991) | namespace detail {
  function noexcept (line 3453) | const noexcept
  function GHC_INLINE (line 3463) | GHC_INLINE const char* filesystem_error::what() const noexcept
  function GHC_INLINE (line 3471) | GHC_INLINE path absolute(const path& p)
  function GHC_INLINE (line 3482) | GHC_INLINE path absolute(const path& p, std::error_code& ec)
  function GHC_INLINE (line 3532) | GHC_INLINE path canonical(const path& p)
  function else (line 3669) | else if ((options & copy_options::create_hard_links) != copy_options::no...
  function else (line 3673) | else if (is_directory(fs_to)) {
  function else (line 3682) | else if (is_directory(fs_from) && (options & copy_options::create_symlin...
  function else (line 3686) | else if (is_directory(fs_from) && (options == copy_options::none || (opt...
  type stat (line 3936) | struct ::stat
  type stat (line 4122) | struct ::stat
  type stat (line 4163) | struct ::stat
  type stat (line 4432) | struct ::stat
  type timeval (line 4434) | struct ::timeval
  type timespec (line 4446) | struct ::timespec
  type timespec (line 4461) | struct ::timespec
  function GHC_INLINE (line 4478) | GHC_INLINE void permissions(const path& p, perms prms, perm_options opts)
  function GHC_INLINE (line 4488) | GHC_INLINE void permissions(const path& p, perms prms, std::error_code& ...
  function GHC_INLINE (line 4493) | GHC_INLINE void permissions(const path& p, perms prms, perm_options opts...
  function GHC_INLINE (line 4540) | GHC_INLINE path proximate(const path& p, std::error_code& ec)
  function GHC_INLINE (line 4551) | GHC_INLINE path proximate(const path& p, const path& base)
  function GHC_INLINE (line 4557) | GHC_INLINE path proximate(const path& p, const path& base, std::error_co...
  function GHC_INLINE (line 4563) | GHC_INLINE path read_symlink(const path& p)
  function GHC_INLINE (line 4574) | GHC_INLINE path read_symlink(const path& p, std::error_code& ec)
  function GHC_INLINE (line 4585) | GHC_INLINE path relative(const path& p, std::error_code& ec)
  function GHC_INLINE (line 4591) | GHC_INLINE path relative(const path& p, const path& base)
  function GHC_INLINE (line 4597) | GHC_INLINE path relative(const path& p, const path& base, std::error_cod...
  function GHC_INLINE (line 4603) | GHC_INLINE bool remove(const path& p)
  function GHC_INLINE (line 4614) | GHC_INLINE bool remove(const path& p, std::error_code& ec) noexcept
  function GHC_INLINE (line 4657) | GHC_INLINE uintmax_t remove_all(const path& p)
  function GHC_INLINE (line 4668) | GHC_INLINE uintmax_t remove_all(const path& p, std::error_code& ec) noex...
  function GHC_INLINE (line 4715) | GHC_INLINE void rename(const path& from, const path& to)
  function GHC_INLINE (line 4725) | GHC_INLINE void rename(const path& from, const path& to, std::error_code...
  function GHC_INLINE (line 4744) | GHC_INLINE void resize_file(const path& p, uintmax_t size)
  function GHC_INLINE (line 4754) | GHC_INLINE void resize_file(const path& p, uintmax_t size, std::error_co...
  function GHC_INLINE (line 4783) | GHC_INLINE space_info space(const path& p)
  function GHC_INLINE (line 4794) | GHC_INLINE space_info space(const path& p, std::error_code& ec) noexcept

FILE: include/glad/glad.h
  type gladGLversionStruct (line 61) | struct gladGLversionStruct {
  type GLenum (line 103) | typedef unsigned int GLenum;
  type GLboolean (line 104) | typedef unsigned char GLboolean;
  type GLbitfield (line 105) | typedef unsigned int GLbitfield;
  type GLvoid (line 106) | typedef void GLvoid;
  type khronos_int8_t (line 107) | typedef khronos_int8_t GLbyte;
  type khronos_uint8_t (line 108) | typedef khronos_uint8_t GLubyte;
  type khronos_int16_t (line 109) | typedef khronos_int16_t GLshort;
  type khronos_uint16_t (line 110) | typedef khronos_uint16_t GLushort;
  type GLint (line 111) | typedef int GLint;
  type GLuint (line 112) | typedef unsigned int GLuint;
  type khronos_int32_t (line 113) | typedef khronos_int32_t GLclampx;
  type GLsizei (line 114) | typedef int GLsizei;
  type khronos_float_t (line 115) | typedef khronos_float_t GLfloat;
  type khronos_float_t (line 116) | typedef khronos_float_t GLclampf;
  type GLdouble (line 117) | typedef double GLdouble;
  type GLclampd (line 118) | typedef double GLclampd;
  type GLchar (line 121) | typedef char GLchar;
  type GLcharARB (line 122) | typedef char GLcharARB;
  type GLhandleARB (line 126) | typedef unsigned int GLhandleARB;
  type khronos_uint16_t (line 128) | typedef khronos_uint16_t GLhalf;
  type khronos_uint16_t (line 129) | typedef khronos_uint16_t GLhalfARB;
  type khronos_int32_t (line 130) | typedef khronos_int32_t GLfixed;
  type khronos_intptr_t (line 131) | typedef khronos_intptr_t GLintptr;
  type khronos_intptr_t (line 132) | typedef khronos_intptr_t GLintptrARB;
  type khronos_ssize_t (line 133) | typedef khronos_ssize_t GLsizeiptr;
  type khronos_ssize_t (line 134) | typedef khronos_ssize_t GLsizeiptrARB;
  type khronos_int64_t (line 135) | typedef khronos_int64_t GLint64;
  type khronos_int64_t (line 136) | typedef khronos_int64_t GLint64EXT;
  type khronos_uint64_t (line 137) | typedef khronos_uint64_t GLuint64;
  type khronos_uint64_t (line 138) | typedef khronos_uint64_t GLuint64EXT;
  type __GLsync (line 139) | struct __GLsync
  type _cl_context (line 140) | struct _cl_context
  type _cl_event (line 141) | struct _cl_event
  type GLhalfNV (line 146) | typedef unsigned short GLhalfNV;
  type GLintptr (line 147) | typedef GLintptr GLvdpauSurfaceNV;
  type GLubyte (line 2112) | typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGPROC)(GLenum name);
  type GLuint (line 2989) | typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTPROC)(GLsizei n, co...
  type GLubyte (line 3851) | typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC)(GLenum name, GLu...
  type const (line 4290) | typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC)(GLuint p...
  type const (line 4293) | typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC)(GLuint program, G...
  type const (line 4716) | typedef GLuint (APIENTRYP PFNGLGETPROGRAMRESOURCEINDEXPROC)(GLuint progr...
  type const (line 4725) | typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONPROC)(GLuint pro...
  type const (line 4728) | typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC)(GLuin...

FILE: include/nvml.h
  type nvmlDevice_st (line 123) | struct nvmlDevice_st
  type nvmlPciInfo_t (line 138) | typedef struct nvmlPciInfo_st
  type nvmlEccErrorCounts_t (line 175) | typedef struct nvmlEccErrorCounts_st
  type nvmlUtilization_t (line 187) | typedef struct nvmlUtilization_st
  type nvmlMemory_t (line 196) | typedef struct nvmlMemory_st
  type nvmlBAR1Memory_t (line 206) | typedef struct nvmlBAR1Memory_st
  type nvmlProcessInfo_t (line 216) | typedef struct nvmlProcessInfo_st
  type nvmlBridgeChipType_t (line 227) | typedef enum nvmlBridgeChipType_enum
  type nvmlNvLinkUtilizationCountUnits_t (line 241) | typedef enum nvmlNvLinkUtilizationCountUnits_enum
  type nvmlNvLinkUtilizationCountPktTypes_t (line 258) | typedef enum nvmlNvLinkUtilizationCountPktTypes_enum
  type nvmlNvLinkUtilizationControl_t (line 274) | typedef struct nvmlNvLinkUtilizationControl_st
  type nvmlNvLinkCapability_t (line 283) | typedef enum nvmlNvLinkCapability_enum
  type nvmlNvLinkErrorCounter_t (line 298) | typedef enum nvmlNvLinkErrorCounter_enum
  type nvmlGpuTopologyLevel_t (line 313) | typedef enum nvmlGpuLevel_enum
  type nvmlGpuP2PStatus_t (line 329) | typedef enum nvmlGpuP2PStatus_enum
  type nvmlGpuP2PCapsIndex_t (line 342) | typedef enum nvmlGpuP2PCapsIndex_enum
  type nvmlBridgeChipInfo_t (line 360) | typedef struct nvmlBridgeChipInfo_st
  type nvmlBridgeChipHierarchy_t (line 370) | typedef struct nvmlBridgeChipHierarchy_st
  type nvmlSamplingType_t (line 379) | typedef enum nvmlSamplingType_enum
  type nvmlPcieUtilCounter_t (line 396) | typedef enum nvmlPcieUtilCounter_enum
  type nvmlValueType_t (line 408) | typedef enum nvmlValueType_enum
  type nvmlValue_t (line 424) | typedef union nvmlValue_st
  type nvmlSample_t (line 436) | typedef struct nvmlSample_st
  type nvmlPerfPolicyType_t (line 445) | typedef enum nvmlPerfPolicyType_enum
  type nvmlViolationTime_t (line 464) | typedef struct nvmlViolationTime_st
  type nvmlEnableState_t (line 481) | typedef enum nvmlEnableState_enum
  type nvmlBrandType_t (line 495) | typedef enum nvmlBrandType_enum
  type nvmlTemperatureThresholds_t (line 512) | typedef enum nvmlTemperatureThresholds_enum
  type nvmlTemperatureSensors_t (line 526) | typedef enum nvmlTemperatureSensors_enum
  type nvmlComputeMode_t (line 541) | typedef enum nvmlComputeMode_enum
  type nvmlMemoryErrorType_t (line 576) | typedef enum nvmlMemoryErrorType_enum
  type nvmlEccCounterType_t (line 607) | typedef enum nvmlEccCounterType_enum
  type nvmlClockType_t (line 621) | typedef enum nvmlClockType_enum
  type nvmlClockId_t (line 636) | typedef enum nvmlClockId_enum
  type nvmlDriverModel_t (line 652) | typedef enum nvmlDriverModel_enum
  type nvmlPstates_t (line 661) | typedef enum nvmlPStates_enum
  type nvmlGpuOperationMode_t (line 689) | typedef enum nvmlGom_enum
  type nvmlInforomObject_t (line 703) | typedef enum nvmlInforomObject_enum
  type nvmlReturn_t (line 716) | typedef enum nvmlReturn_enum
  type nvmlMemoryLocation_t (line 748) | typedef enum nvmlMemoryLocation_enum
  type nvmlPageRetirementCause_t (line 766) | typedef enum nvmlPageRetirementCause_enum
  type nvmlRestrictedAPI_t (line 778) | typedef enum nvmlRestrictedAPI_enum
  type nvmlGpuVirtualizationMode_t (line 803) | typedef enum nvmlGpuVirtualizationMode {
  type nvmlHostVgpuMode_t (line 814) | typedef enum nvmlHostVgpuMode_enum
  type nvmlVgpuVmIdType_t (line 823) | typedef enum nvmlVgpuVmIdType {
  type nvmlVgpuGuestInfoState_t (line 831) | typedef enum nvmlVgpuGuestInfoState_enum
  type nvmlGridLicenseFeatureCode_t (line 840) | typedef enum {
  type nvmlVgpuTypeId_t (line 884) | typedef unsigned int nvmlVgpuTypeId_t;
  type nvmlVgpuInstance_t (line 886) | typedef unsigned int nvmlVgpuInstance_t;
  type nvmlVgpuInstanceUtilizationSample_t (line 891) | typedef struct nvmlVgpuInstanceUtilizationSample_st
  type nvmlVgpuProcessUtilizationSample_t (line 904) | typedef struct nvmlVgpuProcessUtilizationSample_st
  type nvmlProcessUtilizationSample_t (line 919) | typedef struct nvmlProcessUtilizationSample_st
  type nvmlGridLicensableFeature_t (line 932) | typedef struct nvmlGridLicensableFeature_st
  type nvmlGridLicensableFeatures_t (line 944) | typedef struct nvmlGridLicensableFeatures_st
  type nvmlFieldValue_t (line 1093) | typedef struct nvmlFieldValue_st
  type nvmlUnit_st (line 1113) | struct nvmlUnit_st
  type nvmlHwbcEntry_t (line 1118) | typedef struct nvmlHwbcEntry_st
  type nvmlFanState_t (line 1127) | typedef enum nvmlFanState_enum
  type nvmlLedColor_t (line 1136) | typedef enum nvmlLedColor_enum
  type nvmlLedState_t (line 1146) | typedef struct nvmlLedState_st
  type nvmlUnitInfo_t (line 1155) | typedef struct nvmlUnitInfo_st
  type nvmlPSUInfo_t (line 1178) | typedef struct nvmlPSUInfo_st
  type nvmlUnitFanInfo_t (line 1189) | typedef struct nvmlUnitFanInfo_st
  type nvmlUnitFanSpeeds_t (line 1198) | typedef struct nvmlUnitFanSpeeds_st
  type nvmlEventSet_st (line 1215) | struct nvmlEventSet_st
  type nvmlEventData_t (line 1271) | typedef struct nvmlEventData_st
  type nvmlAccountingStats_t (line 1415) | typedef struct nvmlAccountingStats_st {
  type nvmlEncoderType_t (line 1451) | typedef enum nvmlEncoderQueryType_enum
  type nvmlEncoderSessionInfo_t (line 1460) | typedef struct nvmlEncoderSessionInfo_st
  type nvmlFBCSessionType_t (line 1483) | typedef enum nvmlFBCSessionType_enum
  type nvmlFBCStats_t (line 1495) | typedef struct nvmlFBCStats_st
  type nvmlFBCSessionInfo_t (line 1511) | typedef struct nvmlFBCSessionInfo_st
  type nvmlDetachGpuState_t (line 1538) | typedef enum nvmlDetachGpuState_enum
  type nvmlPcieLinkState_t (line 1547) | typedef enum nvmlPcieLinkState_enum
  type nvmlVgpuVersion_t (line 6017) | typedef struct nvmlVgpuVersion_st
  type nvmlVgpuMetadata_t (line 6026) | typedef struct nvmlVgpuMetadata_st
  type nvmlVgpuPgpuMetadata_t (line 6043) | typedef struct nvmlVgpuPgpuMetadata_st
  type nvmlVgpuVmCompatibility_t (line 6058) | typedef enum nvmlVgpuVmCompatibility_enum
  type nvmlVgpuPgpuCompatibilityLimitCode_t (line 6070) | typedef enum nvmlVgpuPgpuCompatibilityLimitCode_enum
  type nvmlVgpuPgpuCompatibility_t (line 6082) | typedef struct nvmlVgpuPgpuCompatibility_st
  type nvmlBlacklistDeviceInfo_t (line 6443) | typedef struct nvmlBlacklistDeviceInfo_st

FILE: include/vulkan/vk_util.h
  type __vk_outarray (line 71) | struct __vk_outarray {
  function __vk_outarray_init (line 95) | static inline void
  function VkResult (line 109) | static inline VkResult
  type __vk_outarray (line 119) | struct __vk_outarray
  function __vk_append_struct (line 199) | static inline void

FILE: src/amdgpu.cpp
  type amdgpu_common_metrics (line 16) | struct amdgpu_common_metrics
  type gpu_metrics_v3_0 (line 18) | struct gpu_metrics_v3_0
  type metrics_table_header (line 19) | struct metrics_table_header
  type metrics_table_header (line 19) | struct metrics_table_header
  type gpu_metrics_v1_3 (line 44) | struct gpu_metrics_v1_3
  type gpu_metrics_v1_3 (line 44) | struct gpu_metrics_v1_3
  type gpu_metrics_v2_3 (line 69) | struct gpu_metrics_v2_3
  type gpu_metrics_v2_3 (line 69) | struct gpu_metrics_v2_3
  type gpu_metrics_v3_0 (line 153) | struct gpu_metrics_v3_0
  type gpu_metrics_v3_0 (line 153) | struct gpu_metrics_v3_0
  type amdgpu_common_metrics (line 226) | struct amdgpu_common_metrics
  type amdgpu_common_metrics (line 306) | struct amdgpu_common_metrics

FILE: src/amdgpu.h
  type metrics_table_header (line 30) | struct metrics_table_header {
  type gpu_metrics_v1_3 (line 36) | struct gpu_metrics_v1_3 {
  type gpu_metrics_v2_3 (line 108) | struct gpu_metrics_v2_3 {
  type gpu_metrics_v2_4 (line 168) | struct gpu_metrics_v2_4 {
  type gpu_metrics_v3_0 (line 237) | struct gpu_metrics_v3_0 {
  type amdgpu_files (line 324) | struct amdgpu_files
  type amdgpu_common_metrics (line 345) | struct amdgpu_common_metrics {
  type amdgpu_common_metrics (line 387) | struct amdgpu_common_metrics
  type amdgpu_common_metrics (line 388) | struct amdgpu_common_metrics
  function gpu_metrics (line 391) | gpu_metrics copy_metrics() {
  function pause (line 396) | void pause() {
  function resume (line 401) | void resume() {
  type amdgpu_files (line 413) | struct amdgpu_files
  type amdgpu_common_metrics (line 420) | struct amdgpu_common_metrics
  function previous_metrics (line 421) | struct gpu_metrics_v3_0 previous_metrics{}

FILE: src/app/control.c
  function help_and_quit (line 10) | static void help_and_quit() {
  function str_to_bool (line 25) | static bool str_to_bool(const char *value)
  function main (line 37) | int main(int argc, char *argv[])

FILE: src/app/main.cpp
  function glfw_error_callback (line 32) | static void glfw_error_callback(int error, const char* description)
  function x_connection_ok (line 51) | static bool x_connection_ok(Display* dpy) {
  function get_prop (line 66) | static unsigned int get_prop(const char* propName){
  function ctrl_thread (line 97) | static void ctrl_thread(){
  function gamescope_frametime (line 154) | static void gamescope_frametime(uint64_t app_frametime_ns, uint64_t late...
  function msg_read_thread (line 171) | static void msg_read_thread(){
  function GLFWwindow (line 248) | static GLFWwindow* init(const char* glsl_version){
  function shutdown (line 275) | static void shutdown(GLFWwindow* window){
  function get_atom_info (line 282) | static void get_atom_info(){
  function render (line 287) | static bool render(GLFWwindow* window, overlay_params& real_params) {
  function main (line 319) | int main(int, char**)

FILE: src/app/mangoapp_proto.h
  type mangoapp_msg_header (line 3) | struct mangoapp_msg_header {
  type mangoapp_msg_v1 (line 8) | struct mangoapp_msg_v1 {
  type mangoapp_ctrl_header (line 23) | struct mangoapp_ctrl_header {
  type mangoapp_ctrl_msgid1_v1 (line 29) | struct mangoapp_ctrl_msgid1_v1 {

FILE: src/battery.h
  function class (line 4) | class BatteryStats{

FILE: src/blacklist.cpp
  function get_proc_name (line 15) | static std::string get_proc_name() {
  function check_blacklisted (line 74) | static bool check_blacklisted() {
  function is_blacklisted (line 90) | bool is_blacklisted(bool force_recheck) {
  function add_blacklist (line 97) | void add_blacklist(const std::string& new_item) {

FILE: src/config.cpp
  function parseConfigLine (line 15) | void parseConfigLine(std::string line, std::unordered_map<std::string, s...
  function get_program_dir (line 36) | static std::string get_program_dir() {
  function get_program_name (line 48) | std::string get_program_name() {
  function enumerate_config_files (line 65) | static void enumerate_config_files(std::vector<std::string>& paths) {
  function parseConfigFile (line 101) | void parseConfigFile(overlay_params& params) {

FILE: src/control.cpp
  function parse_command (line 14) | static void parse_command(overlay_params &params,
  function process_char (line 52) | static void process_char(const int control_client, overlay_params &param...
  function control_send (line 108) | void control_send(int control_client,
  function control_send_connection_string (line 132) | static void control_send_connection_string(int control_client, const std...
  function control_client_check (line 153) | void control_client_check(int control, int& control_client, const std::s...
  function control_client_disconnected (line 175) | static void control_client_disconnected(int& control_client)
  function process_control_socket (line 181) | void process_control_socket(int& control_client, overlay_params &params)

FILE: src/cpu.cpp
  function calculateCPUData (line 39) | static void calculateCPUData(CPUData& cpuData,
  function get_cpu_power_k10temp (line 312) | static bool get_cpu_power_k10temp(CPUPowerData* cpuPowerData, float& pow...
  function get_cpu_power_zenpower (line 359) | static bool get_cpu_power_zenpower(CPUPowerData* cpuPowerData, float& po...
  function get_cpu_power_zenergy (line 383) | static bool get_cpu_power_zenergy(CPUPowerData* cpuPowerData, float& pow...
  function get_cpu_power_rapl (line 410) | static bool get_cpu_power_rapl(CPUPowerData* cpuPowerData, float& power) {
  function get_cpu_power_amdgpu (line 437) | static bool get_cpu_power_amdgpu(float& power) {
  function get_cpu_power_xgene (line 448) | static bool get_cpu_power_xgene(CPUPowerData* cpuPowerData, float& power) {
  function find_input (line 501) | static bool find_input(const std::string& path, const char* input_prefix...
  function find_fallback_input (line 523) | static bool find_fallback_input(const std::string& path, const char* inp...
  function check_thermal_zones (line 540) | static void check_thermal_zones(std::string& path, std::string& input) {
  function CPUPowerData_k10temp (line 642) | static CPUPowerData_k10temp* init_cpu_power_data_k10temp(const std::stri...
  function CPUPowerData_zenpower (line 675) | static CPUPowerData_zenpower* init_cpu_power_data_zenpower(const std::st...
  function CPUPowerData_zenergy (line 692) | static CPUPowerData_zenergy* init_cpu_power_data_zenergy(const std::stri...
  function CPUPowerData_rapl (line 704) | static CPUPowerData_rapl* init_cpu_power_data_rapl(const std::string pat...
  function CPUPowerData_xgene (line 720) | static CPUPowerData_xgene* init_cpu_power_data_xgene(const std::string p...

FILE: src/cpu_win32.cpp
  function FileTimeToInt64 (line 10) | uint64_t FileTimeToInt64( const FILETIME& ft ) {

FILE: src/dbus.cpp
  type mutexed_metadata (line 15) | struct mutexed_metadata
  type dbusmgr (line 17) | namespace dbusmgr {
    function DBusHandlerResult (line 274) | DBusHandlerResult dbus_manager::filter_signals(DBusConnection* conn,
    type dbus_ep (line 350) | struct dbus_ep
  function assign_metadata_value (line 22) | static void assign_metadata_value(metadata& meta, const std::string& key,
  function format_signal (line 48) | static std::string format_signal(const dbusmgr::DBusSignal& s) {
  function parse_song_data (line 55) | static void parse_song_data(DBusMessageIter_wrap iter, metadata& meta){
  function parse_mpris_properties (line 74) | static void parse_mpris_properties(libdbus_loader& dbus, DBusMessage* msg,
  function dbus_get_name_owner (line 103) | static bool dbus_get_name_owner(dbusmgr::dbus_manager& dbus_mgr,
  function dbus_get_player_property (line 119) | static bool dbus_get_player_property(dbusmgr::dbus_manager& dbus_mgr, me...
  type dbusmgr (line 143) | namespace dbusmgr {
    function DBusHandlerResult (line 274) | DBusHandlerResult dbus_manager::filter_signals(DBusConnection* conn,
    type dbus_ep (line 350) | struct dbus_ep

FILE: src/dbus_helpers.h
  function namespace (line 11) | namespace DBus_helpers {
  function is_signed (line 116) | bool DBusMessageIter_wrap::is_signed() const noexcept {
  function DBusMessageIter_wrap (line 158) | auto DBusMessageIter_wrap::get_primitive<std::string>() -> std::string {
  function get_unsigned (line 165) | uint64_t DBusMessageIter_wrap::get_unsigned() {
  function get_signed (line 181) | int64_t DBusMessageIter_wrap::get_signed() {
  function DBusMessageIter_wrap (line 195) | auto DBusMessageIter_wrap::get_stringified() -> std::string {
  function class (line 284) | class DBusMessage_wrap {
  function DBusMessage_wrap (line 334) | DBusMessage_wrap DBusMessage_wrap::send_with_reply_and_block(
  function DBusMessage_wrap (line 351) | DBusMessage_wrap DBusMessage_wrap::new_method_call(const std::string& bu...
  function free_if_owning (line 362) | void DBusMessage_wrap::free_if_owning() {

FILE: src/dbus_info.h
  type metadata (line 19) | struct metadata {
  type mp_fmt (line 33) | struct mp_fmt
  type mutexed_metadata (line 39) | struct mutexed_metadata {
  type SignalType (line 52) | enum SignalType {
  type mutexed_metadata (line 57) | struct mutexed_metadata
  function namespace (line 59) | namespace dbusmgr {

FILE: src/device.cpp
  function device_update (line 32) | void device_update(const struct overlay_params& params){
  function device_info (line 99) | void device_info () {

FILE: src/device.h
  type overlay_params (line 7) | struct overlay_params
  type device_batt (line 8) | struct device_batt {

FILE: src/elfhacks.c
  type eh_iterate_callback_args (line 38) | struct eh_iterate_callback_args {
  type dl_phdr_info (line 44) | struct dl_phdr_info
  type dl_phdr_info (line 53) | struct dl_phdr_info
  function eh_find_callback (line 61) | int eh_find_callback(struct dl_phdr_info *info, size_t size, void *argptr)
  function eh_iterate_callback (line 84) | int eh_iterate_callback(struct dl_phdr_info *info, size_t size, void *ar...
  function eh_iterate_obj (line 111) | int eh_iterate_obj(eh_iterate_obj_callback_func callback, void *arg)
  function eh_find_obj (line 125) | int eh_find_obj(eh_obj_t *obj, const char *soname)
  function eh_check_addr (line 140) | int eh_check_addr(eh_obj_t *obj, const void *addr)
  function eh_init_obj (line 159) | int eh_init_obj(eh_obj_t *obj)
  function eh_find_sym (line 243) | int eh_find_sym(eh_obj_t *obj, const char *name, void **to)
  function eh_hash_elf (line 266) | ElfW(Word) eh_hash_elf(const char *name)
  function eh_find_sym_hash (line 283) | int eh_find_sym_hash(eh_obj_t *obj, const char *name, eh_sym_t *sym)
  function Elf32_Word (line 335) | Elf32_Word eh_hash_gnu(const char *name)
  function eh_find_sym_gnu_hash (line 347) | int eh_find_sym_gnu_hash(eh_obj_t *obj, const char *name, eh_sym_t *sym)
  function eh_iterate_sym (line 424) | int eh_iterate_sym(eh_obj_t *obj, eh_iterate_sym_callback_func callback,...
  function eh_find_next_dyn (line 429) | int eh_find_next_dyn(eh_obj_t *obj, ElfW_Sword tag, int i, ElfW(Dyn) **n...
  function eh_set_rela_plt (line 456) | int eh_set_rela_plt(eh_obj_t *obj, int p, const char *sym, void *val)
  function eh_set_rel_plt (line 477) | int eh_set_rel_plt(eh_obj_t *obj, int p, const char *sym, void *val)
  function eh_set_rel (line 497) | int eh_set_rel(eh_obj_t *obj, const char *sym, void *val)
  function eh_iterate_rela_plt (line 527) | int eh_iterate_rela_plt(eh_obj_t *obj, int p, eh_iterate_rel_callback_fu...
  function eh_iterate_rel_plt (line 557) | int eh_iterate_rel_plt(eh_obj_t *obj, int p, eh_iterate_rel_callback_fun...
  function eh_iterate_rel (line 587) | int eh_iterate_rel(eh_obj_t *obj, eh_iterate_rel_callback_func callback,...
  function eh_destroy_obj (line 611) | int eh_destroy_obj(eh_obj_t *obj)

FILE: src/fcat.h
  type fcatoverlay (line 18) | struct fcatoverlay{
  function ImColor (line 24) | ImColor get_next_color (const swapchain_stats& sw_stats){

FILE: src/fex.cpp
  function AlignUp (line 14) | constexpr uint64_t AlignUp(uint64_t Value, uint64_t Alignment) {
  type fex (line 18) | namespace fex {
    type AppType (line 34) | enum class AppType : uint8_t {
    type fex_stats_header (line 43) | struct fex_stats_header {
    type fex_thread_stats (line 55) | struct fex_thread_stats {
    type fex_stats (line 71) | struct fex_stats {
      type retained_stats (line 85) | struct retained_stats {
    function fex_thread_stats (line 115) | static fex_thread_stats *offset_to_stats(void* shm_base, uint32_t *off...
    function fex_thread_stats (line 121) | static fex_thread_stats *offset_to_stats(void* shm_base, uint32_t offs...
    function memory_barrier (line 127) | static void memory_barrier() {
    function get_cycle_counter_frequency (line 130) | static uint64_t get_cycle_counter_frequency() {
    function is_fex_capable (line 136) | bool is_fex_capable() {
    function memory_barrier (line 142) | static void memory_barrier() {
    function cpuid (line 145) | static void cpuid(uint32_t leaf, uint32_t &eax, uint32_t &ebx, uint32_...
    function is_fex_capable (line 151) | bool is_fex_capable() {
    function get_cycle_counter_frequency (line 175) | static uint64_t get_cycle_counter_frequency() {
    function atomic_copy_thread_stats (line 190) | static void atomic_copy_thread_stats(fex_thread_stats *dest, const fex...
    function destroy_shm (line 210) | static void destroy_shm() {
    function init_shm (line 221) | static void init_shm(int pid) {
    function check_shm_update_necessary (line 307) | static void check_shm_update_necessary() {
    function is_fex_pid_found (line 329) | bool is_fex_pid_found() {
    function update_fex_stats (line 333) | void update_fex_stats() {

FILE: src/fex.h
  function namespace (line 9) | namespace fex {
  function account_time (line 37) | void account_time(std::chrono::time_point<std::chrono::steady_clock> now) {
  function last_sample_count (line 44) | uint64_t last_sample_count{}
  function average_sec (line 45) | double average_sec{}

FILE: src/file_utils.cpp
  function read_line (line 17) | std::string read_line(const std::string& filename)
  function get_basename (line 28) | std::string get_basename(const std::string&& path)
  function ls (line 40) | std::vector<std::string> ls(const char* root, const char* prefix, LS_FLA...
  function file_exists (line 89) | bool file_exists(const std::string& path)
  function dir_exists (line 95) | bool dir_exists(const std::string& path)
  function read_symlink (line 101) | std::string read_symlink(const char * link)
  function read_symlink (line 108) | std::string read_symlink(const std::string&& link)
  function get_exe_path (line 113) | std::string get_exe_path()
  function get_wine_exe_name (line 118) | std::string get_wine_exe_name(bool keep_ext)
  function get_home_dir (line 154) | std::string get_home_dir()
  function get_data_dir (line 164) | std::string get_data_dir()
  function get_config_dir (line 176) | std::string get_config_dir()
  function lib_loaded (line 188) | bool lib_loaded(const std::string& lib, pid_t pid) {
  function remove_parentheses (line 209) | std::string remove_parentheses(const std::string& text) {
  function to_lower (line 215) | std::string to_lower(const std::string& str) {

FILE: src/file_utils.h
  type LS_FLAGS (line 12) | enum LS_FLAGS

FILE: src/file_utils_win32.cpp
  function ls (line 6) | std::vector<std::string> ls(const char* root, const char* prefix, LS_FLA...
  function file_exists (line 12) | bool file_exists(const std::string& path)
  function dir_exists (line 17) | bool dir_exists(const std::string& path)
  function get_exe_path (line 22) | std::string get_exe_path()
  function get_wine_exe_name (line 27) | std::string get_wine_exe_name(bool keep_ext)
  function get_home_dir (line 32) | std::string get_home_dir()
  function get_data_dir (line 38) | std::string get_data_dir()
  function get_config_dir (line 44) | std::string get_config_dir()

FILE: src/font.cpp
  function create_fonts (line 8) | void create_fonts(ImFontAtlas* font_atlas, const overlay_params& params,...

FILE: src/fps_limiter.h
  function class (line 5) | class fpsLimiter {

FILE: src/fps_metrics.h
  type metric_t (line 15) | struct metric_t {
  function _thread (line 34) | void _thread() {

FILE: src/ftrace.cpp
  type FTrace (line 13) | namespace FTrace {
    type pollfd (line 69) | struct pollfd
    function get_field_value (line 110) | static std::string get_field_value(std::string fields_str, std::string...

FILE: src/ftrace.h
  function namespace (line 15) | namespace FTrace {
  function class (line 48) | class FTrace {

FILE: src/gl/gl_hud.cpp
  type MangoHud (line 30) | namespace MangoHud { namespace GL {
    type GL (line 30) | namespace GL {
      type GLVec (line 32) | struct GLVec
        method GLint (line 36) | GLint operator[] (size_t i)
      type imgui_contexts (line 57) | struct imgui_contexts
      function imgui_init (line 71) | void imgui_init()
      function imgui_create (line 104) | void imgui_create(gl_context *ctx, const gl_wsi plat)
      function imgui_shutdown (line 188) | void imgui_shutdown(gl_context *ctx, bool last)
      function imgui_render (line 204) | void imgui_render(gl_context *ctx, unsigned int width, unsigned int ...

FILE: src/gl/gl_hud.h
  function namespace (line 8) | namespace MangoHud { namespace GL {

FILE: src/gl/gl_renderer.cpp
  type MangoHud (line 79) | namespace MangoHud { namespace GL {
    type GL (line 79) | namespace GL {
      function ImGui_ImplOpenGL3_DestroyFontsTexture (line 90) | void ImGui_ImplOpenGL3_DestroyFontsTexture(gl_context *ctx)
      function ImGui_ImplOpenGL3_CreateFontsTexture (line 101) | bool ImGui_ImplOpenGL3_CreateFontsTexture(gl_context *ctx)
      function CheckShader (line 161) | static bool CheckShader(GLuint handle, const char* desc)
      function CheckProgram (line 179) | static bool CheckProgram(GLuint handle, const char* desc)
      function ImGui_ImplOpenGL3_CreateDeviceObjects (line 196) | static bool    ImGui_ImplOpenGL3_CreateDeviceObjects(gl_context *ctx)
      function ImGui_ImplOpenGL3_DestroyDeviceObjects (line 375) | static void    ImGui_ImplOpenGL3_DestroyDeviceObjects(gl_context *ctx)
      function GetOpenGLVersion (line 388) | void GetOpenGLVersion(int& major, int& minor, bool& isGLES)
      function ImGui_ImplOpenGL3_Init (line 423) | bool    ImGui_ImplOpenGL3_Init(gl_context* ctx, const char* glsl_ver...
      function ImGui_ImplOpenGL3_Shutdown (line 488) | void    ImGui_ImplOpenGL3_Shutdown(gl_context* ctx)
      function ImGui_ImplOpenGL3_NewFrame (line 498) | void    ImGui_ImplOpenGL3_NewFrame(gl_context* ctx)
      function ImGui_ImplOpenGL3_SetupRenderState (line 515) | static void ImGui_ImplOpenGL3_SetupRenderState(ImDrawData* draw_data...
      function ImGui_ImplOpenGL3_RenderDrawData (line 588) | void    ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data)

FILE: src/gl/gl_renderer.h
  function namespace (line 30) | namespace MangoHud { namespace GL {

FILE: src/gl/glad.c
  function open_gl (line 57) | static
  function close_gl (line 72) | static
  function open_gl (line 88) | static
  function close_gl (line 119) | static
  function gladLoadGL (line 149) | int gladLoadGL(void) {
  type gladGLversionStruct (line 160) | struct gladGLversionStruct
  function get_exts (line 173) | static int get_exts(void) {
  function free_exts (line 207) | static void free_exts(void) {
  function has_ext (line 218) | static int has_ext(const char *ext) {
  function load_GL_VERSION_1_0 (line 1335) | static void load_GL_VERSION_1_0(GLADloadproc load) {
  function load_GL_VERSION_1_1 (line 1644) | static void load_GL_VERSION_1_1(GLADloadproc load) {
  function load_GL_VERSION_1_2 (line 1677) | static void load_GL_VERSION_1_2(GLADloadproc load) {
  function load_GL_VERSION_1_3 (line 1684) | static void load_GL_VERSION_1_3(GLADloadproc load) {
  function load_GL_VERSION_1_4 (line 1733) | static void load_GL_VERSION_1_4(GLADloadproc load) {
  function load_GL_VERSION_1_5 (line 1783) | static void load_GL_VERSION_1_5(GLADloadproc load) {
  function load_GL_VERSION_2_0 (line 1805) | static void load_GL_VERSION_2_0(GLADloadproc load) {
  function load_GL_VERSION_2_1 (line 1901) | static void load_GL_VERSION_2_1(GLADloadproc load) {
  function load_GL_VERSION_3_0 (line 1910) | static void load_GL_VERSION_3_0(GLADloadproc load) {
  function load_GL_VERSION_3_1 (line 1997) | static void load_GL_VERSION_3_1(GLADloadproc load) {
  function load_GL_VERSION_3_2 (line 2015) | static void load_GL_VERSION_3_2(GLADloadproc load) {
  function load_GL_VERSION_3_3 (line 2037) | static void load_GL_VERSION_3_3(GLADloadproc load) {
  function load_GL_VERSION_4_0 (line 2098) | static void load_GL_VERSION_4_0(GLADloadproc load) {
  function load_GL_VERSION_4_1 (line 2147) | static void load_GL_VERSION_4_1(GLADloadproc load) {
  function load_GL_VERSION_4_2 (line 2239) | static void load_GL_VERSION_4_2(GLADloadproc load) {
  function load_GL_VERSION_4_3 (line 2254) | static void load_GL_VERSION_4_3(GLADloadproc load) {
  function load_GL_VERSION_4_4 (line 2301) | static void load_GL_VERSION_4_4(GLADloadproc load) {
  function load_GL_VERSION_4_5 (line 2313) | static void load_GL_VERSION_4_5(GLADloadproc load) {
  function load_GL_VERSION_4_6 (line 2438) | static void load_GL_VERSION_4_6(GLADloadproc load) {
  function load_GL_ARB_clip_control (line 2445) | static void load_GL_ARB_clip_control(GLADloadproc load) {
  function find_extensionsGL (line 2449) | static int find_extensionsGL(void) {
  function find_coreGL (line 2456) | static void find_coreGL(void) {
  function gladLoadGLLoader (line 2517) | int gladLoadGLLoader(GLADloadproc load) {
  function load_GL_ES_VERSION_2_0 (line 2548) | static void load_GL_ES_VERSION_2_0(GLADloadproc load) {
  function load_GL_ES_VERSION_3_0 (line 2693) | static void load_GL_ES_VERSION_3_0(GLADloadproc load) {
  function load_GL_ES_VERSION_3_1 (line 2800) | static void load_GL_ES_VERSION_3_1(GLADloadproc load) {
  function load_GL_ES_VERSION_3_2 (line 2871) | static void load_GL_ES_VERSION_3_2(GLADloadproc load) {
  function load_GL_EXT_clip_control (line 2918) | static void load_GL_EXT_clip_control(GLADloadproc load) {
  function find_extensionsGLES2 (line 2922) | static int find_extensionsGLES2(void) {
  function find_coreGLES2 (line 2929) | static void find_coreGLES2(void) {
  function gladLoadGLES2Loader (line 2975) | int gladLoadGLES2Loader(GLADloadproc load) {

FILE: src/gl/inject_egl.cpp
  function gl_context (line 78) | static gl_context *create_gl_context(void *ctx)
  function destroy_gl_context (line 89) | static void destroy_gl_context(gl_context *gl_ctx)
  function eglDestroyContext (line 97) | eglDestroyContext(void* dpy, void* ctx)
  function eglSwapBuffers (line 136) | eglSwapBuffers(void* dpy, void* surf)
  function eglGetPlatformDisplay (line 177) | eglGetPlatformDisplay( unsigned int platform, void* native_display, cons...
  function eglGetDisplay (line 199) | eglGetDisplay( void* native_display )
  function eglTerminate (line 232) | eglTerminate(void *display)
  type func_ptr (line 252) | struct func_ptr {
  function mangohud_find_egl_ptr (line 269) | mangohud_find_egl_ptr(const char *name)
  function eglGetProcAddress (line 282) | eglGetProcAddress(const char* procName) {

FILE: src/gl/inject_glx.cpp
  function glx_mesa_queryInteger (line 61) | bool glx_mesa_queryInteger(int attrib, unsigned int *value)
  function gl_context (line 71) | static gl_context *create_gl_context(void *ctx)
  function destroy_gl_context (line 82) | static void destroy_gl_context(gl_context *gl_ctx)
  function glXDestroyContext (line 89) | glXDestroyContext(void *dpy, void *ctx)
  function do_imgui_swap (line 128) | static void do_imgui_swap(void *dpy, void *drawable)
  function set_swap_interval (line 178) | static void set_swap_interval(void* dpy, void* drawable, int interval)
  function glXSwapBuffers (line 219) | glXSwapBuffers(void* dpy, void* drawable) {
  function glXSwapBuffersMscOML (line 234) | glXSwapBuffersMscOML(void* dpy, void* drawable, int64_t target_msc, int6...
  function glXSwapIntervalEXT (line 255) | glXSwapIntervalEXT(void *dpy, void *draw, int interval) {
  function glXSwapIntervalSGI (line 264) | glXSwapIntervalSGI(int interval) {
  function glXSwapIntervalMESA (line 274) | glXSwapIntervalMESA(unsigned int interval) {
  function glXGetSwapIntervalMESA (line 284) | glXGetSwapIntervalMESA() {
  type func_ptr (line 307) | struct func_ptr {
  function mangohud_find_glx_ptr (line 328) | mangohud_find_glx_ptr(const char *name)
  function glXGetProcAddress (line 341) | glXGetProcAddress(const unsigned char* procName) {
  function glXGetProcAddressARB (line 352) | glXGetProcAddressARB(const unsigned char* procName) {

FILE: src/gl/shim.c
  function free_indirect (line 20) | static inline void
  function load_adjacent_opengl_lib (line 26) | static bool load_adjacent_opengl_lib(void)
  function loadMangoHud (line 84) | static void loadMangoHud() {
  type func_ptr (line 177) | struct func_ptr
  function save_and_consume_real_dlerror (line 239) | static void save_and_consume_real_dlerror()

FILE: src/gpu.h
  function class (line 20) | class GPU {
  function gpu_metrics (line 53) | gpu_metrics get_metrics() {
  function pause (line 74) | void pause() {
  function resume (line 85) | void resume() {
  function is_apu (line 96) | bool is_apu() {
  function class (line 122) | class GPUS {

FILE: src/gpu_fdinfo.h
  type hwmon_sensor (line 27) | struct hwmon_sensor {
  type GPU_throttle_status (line 35) | enum GPU_throttle_status : int {
  function class (line 42) | class GPU_fdinfo {
  function pause (line 232) | void pause()
  function resume (line 238) | void resume()

FILE: src/gpu_metrics_util.h
  type gpu_metrics (line 4) | struct gpu_metrics {
  function memory_temp (line 8) | int memory_temp {-1};

FILE: src/hud_elements.cpp
  function SRGBToLinear (line 40) | static float SRGBToLinear(float in)
  function ImVec4 (line 48) | static ImVec4 SRGBToLinear(ImVec4 col)
  function LinearToPQ (line 58) | static float LinearToPQ(float in)
  function dot (line 74) | static double dot(const ImVec4& a, const ImVec4& b)
  function ImVec4 (line 79) | static ImVec4 SRGBtoBT2020(ImVec4 col)
  function ImVec4 (line 96) | static ImVec4 LinearToPQ(ImVec4 col)
  function LinearToHLG (line 107) | static float LinearToHLG(float in)
  function ImVec4 (line 119) | static ImVec4 LinearToHLG(ImVec4 col)
  function R (line 131) | R format_units(T value, const char*& unit)
  type overlay_params (line 144) | struct overlay_params
  type overlay_params (line 203) | struct overlay_params
  function ImguiNextColumnFirstItem (line 226) | static void ImguiNextColumnFirstItem()
  function ImguiNextColumnOrNewRow (line 234) | static void ImguiNextColumnOrNewRow(int column = -1)
  function ImGuiTextOverflow (line 249) | static bool ImGuiTextOverflow(const char* text) {
  function ImGuiTableSetColumnIndex (line 255) | static void ImGuiTableSetColumnIndex(int column)
  type LOAD_DATA (line 293) | struct LOAD_DATA
  type LOAD_DATA (line 435) | struct LOAD_DATA
  function get_core_load_stat (line 515) | static float get_core_load_stat(void *data, int idx){
  type LOAD_DATA (line 572) | struct LOAD_DATA
  type LOAD_DATA (line 843) | struct LOAD_DATA
  type LOAD_DATA (line 882) | struct LOAD_DATA
  function TransformForward_Custom (line 962) | static inline double TransformForward_Custom(double v, void*) {
  function TransformInverse_Custom (line 969) | static inline double TransformInverse_Custom(double v, void*) {

FILE: src/hud_elements.h
  type Function (line 17) | struct Function {
  function class (line 23) | class HudElements{

FILE: src/imgui_utils.h
  type imgui_contexts (line 9) | struct imgui_contexts {
  function destroy_imgui_contexts (line 26) | static void destroy_imgui_contexts(imgui_contexts& contexts)
  function imgui_contexts (line 36) | static imgui_contexts get_current_imgui_contexts() {
  function make_imgui_contexts_current (line 45) | static void make_imgui_contexts_current(imgui_contexts contexts)

FILE: src/iostats.cpp
  type iostats (line 6) | struct iostats
  function getIoStats (line 8) | void getIoStats(iostats& io) {

FILE: src/iostats.h
  type iostats (line 8) | struct iostats {

FILE: src/keybinds.cpp
  function check_keybinds (line 16) | void check_keybinds(struct overlay_params& params){

FILE: src/keybinds.h
  type KeySym (line 14) | typedef unsigned long KeySym;

FILE: src/loaders/loader_dbus.h
  function class (line 12) | class libdbus_loader {

FILE: src/loaders/loader_glx.h
  function class (line 5) | class glx_loader {

FILE: src/loaders/loader_nvctrl.cpp
  function get_libnvctrl_loader (line 16) | std::shared_ptr<libnvctrl_loader> get_libnvctrl_loader()

FILE: src/loaders/loader_nvctrl.h
  function class (line 13) | class libnvctrl_loader {

FILE: src/loaders/loader_nvml.cpp
  function get_libnvml_loader (line 19) | std::shared_ptr<libnvml_loader> get_libnvml_loader()

FILE: src/loaders/loader_nvml.h
  type nvmlProcessInfo_t (line 11) | typedef nvmlProcessInfo_t nvmlProcessInfo_v1_t;
  function class (line 19) | class libnvml_loader {

FILE: src/loaders/loader_x11.cpp
  function get_libx11 (line 110) | std::shared_ptr<libx11_loader> get_libx11()

FILE: src/loaders/loader_x11.h
  function class (line 8) | class libx11_loader {

FILE: src/logging.cpp
  function string (line 25) | string exec(string command) {
  function upload_file (line 42) | static void upload_file(std::string logFile){
  function upload_files (line 52) | static void upload_files(const std::vector<std::string>& logFiles){
  function compareByFps (line 63) | static bool compareByFps(const logData &a, const logData &b)
  function writeSummary (line 68) | static void writeSummary(string filename){
  function writeFileHeaders (line 185) | static void writeFileHeaders(ofstream& out){
  function string (line 237) | static string get_log_suffix(){
  function autostart_log (line 354) | void autostart_log(int sleep) {

FILE: src/logging.h
  type logData (line 16) | struct logData{
  function class (line 36) | class Logger {

FILE: src/memory.cpp
  function update_meminfo (line 17) | void update_meminfo() {
  function update_mem_temp (line 37) | void update_mem_temp() {
  function update_procmem (line 64) | void update_procmem()

FILE: src/mesa/util/os_socket.c
  function os_socket_listen_abstract (line 20) | int
  function os_socket_accept (line 44) | int
  function os_socket_recv (line 50) | ssize_t
  function os_socket_send (line 56) | ssize_t
  function os_socket_block (line 62) | void
  function os_socket_close (line 76) | void
  function os_socket_listen_abstract (line 84) | int
  function os_socket_accept (line 91) | int
  function os_socket_recv (line 98) | ssize_t
  function os_socket_send (line 105) | ssize_t
  function os_socket_block (line 112) | void
  function os_socket_close (line 117) | void

FILE: src/mesa/util/os_socket.h
  type SSIZE_T (line 15) | typedef SSIZE_T ssize_t;

FILE: src/mesa/util/os_time.c
  function os_time_get_nano (line 65) | int64_t
  function os_time_sleep (line 105) | void
  function os_time_get_absolute_timeout (line 130) | int64_t
  function os_wait_until_zero (line 150) | bool
  function os_wait_until_zero_abs_timeout (line 184) | bool

FILE: src/mesa/util/os_time.h
  function os_time_timeout (line 67) | static inline bool

FILE: src/net.cpp
  function safe_stoll (line 31) | long long safe_stoll(const std::string& str, long long default_value = 0) {

FILE: src/net.h
  function class (line 24) | class Net {

FILE: src/notify.cpp
  function fileChanged (line 13) | static void fileChanged(notify_thread *nt) {
  function start_notifier (line 43) | bool start_notifier(notify_thread& nt)
  function stop_notifier (line 64) | void stop_notifier(notify_thread& nt)

FILE: src/notify.h
  type notify_thread (line 9) | struct notify_thread

FILE: src/nvapi.cpp
  function checkNVAPI (line 25) | bool checkNVAPI(){
  function nvapi_util (line 55) | void nvapi_util()

FILE: src/nvidia.cpp
  type gpu_metrics (line 78) | struct gpu_metrics
  type overlay_params (line 78) | struct overlay_params
  type nvmlUtilization_st (line 84) | struct nvmlUtilization_st
  type nvmlMemory_st (line 102) | struct nvmlMemory_st
  type gpu_metrics (line 158) | struct gpu_metrics
  type gpu_metrics (line 225) | struct gpu_metrics

FILE: src/nvidia.h
  function gpu_metrics (line 18) | gpu_metrics copy_metrics() {
  function nvml_get_process_info (line 33) | void nvml_get_process_info() {
  type gpu_metrics (line 110) | struct gpu_metrics

FILE: src/overlay.cpp
  type benchmark_stats (line 44) | struct benchmark_stats
  function init_spdlog (line 57) | void init_spdlog()
  function update_hw_info (line 102) | void update_hw_info(const struct overlay_params& params, uint32_t vendorID)
  type hw_info_updater (line 169) | struct hw_info_updater
    type overlay_params (line 173) | struct overlay_params
    method hw_info_updater (line 180) | hw_info_updater()
    method update (line 195) | void update(const struct overlay_params* params_, uint32_t vendorID_)
    method run (line 207) | void run(){
  function stop_hw_updater (line 225) | void stop_hw_updater()
  function update_hud_info_with_frametime (line 231) | void update_hud_info_with_frametime(struct swapchain_stats& sw_stats, co...
  function update_hud_info (line 312) | void update_hud_info(struct swapchain_stats& sw_stats, const struct over...
  function get_time_stat (line 319) | float get_time_stat(void *_data, int _idx)
  function overlay_new_frame (line 333) | void overlay_new_frame(const struct overlay_params& params)
  function overlay_end_frame (line 347) | void overlay_end_frame()
  function position_layer (line 352) | void position_layer(struct swapchain_stats& data, const struct overlay_p...
  function RenderOutlinedText (line 411) | void RenderOutlinedText(const char* text, ImU32 textColor) {
  function right_aligned_text (line 435) | void right_aligned_text(ImVec4& col, float off_x, const char *fmt, ...)
  function center_text (line 453) | void center_text(const std::string& text)
  function get_ticker_limited_pos (line 459) | static float get_ticker_limited_pos(float pos, float tw, float& left_lim...
  function render_mpris_metadata (line 480) | void render_mpris_metadata(const struct overlay_params& params, mutexed_...
  function render_benchmark (line 542) | static void render_benchmark(swapchain_stats& data, const struct overlay...
  function ImVec4 (line 613) | ImVec4 change_on_load_temp(LOAD_DATA& data, unsigned current)
  function horizontal_separator (line 633) | void horizontal_separator(struct overlay_params& params) {
  function render_imgui (line 663) | void render_imgui(swapchain_stats& data, struct overlay_params& params, ...
  function init_cpu_stats (line 747) | void init_cpu_stats(overlay_params& params)
  type pci_bus (line 758) | struct pci_bus {
  function init_system_info (line 765) | void init_system_info(){
  function check_for_vkbasalt_and_gamemode (line 858) | void check_for_vkbasalt_and_gamemode() {
  function update_fan (line 874) | void update_fan(){
  function next_hud_position (line 897) | void next_hud_position(){

FILE: src/overlay.h
  type frame_stat (line 17) | struct frame_stat {
  type EngineTypes (line 23) | enum EngineTypes
  type swapchain_stats (line 43) | struct swapchain_stats {
  type benchmark_stats (line 80) | struct benchmark_stats {
  type LOAD_DATA (line 86) | struct LOAD_DATA {
  type benchmark_stats (line 145) | struct benchmark_stats
  type overlay_params (line 156) | struct overlay_params
  type swapchain_stats (line 158) | struct swapchain_stats
  type overlay_params (line 158) | struct overlay_params
  type overlay_params (line 159) | struct overlay_params
  type swapchain_stats (line 160) | struct swapchain_stats
  type overlay_params (line 160) | struct overlay_params
  type swapchain_stats (line 161) | struct swapchain_stats
  type overlay_params (line 161) | struct overlay_params
  type overlay_params (line 162) | struct overlay_params
  type overlay_params (line 182) | struct overlay_params

FILE: src/overlay_params.cpp
  function get_hash (line 57) | size_t get_hash(Ts const&... args)
  function get_hash (line 68) | size_t get_hash()
  function get_hash (line 74) | size_t get_hash(T const& first, Ts const&... rest)
  function parse_vulkan_present_mode_name (line 88) | bool parse_vulkan_present_mode_name(std::string_view name, VkPresentMode...
  function parse_position (line 118) | static enum overlay_param_position
  function parse_control (line 140) | static int
  function parse_float (line 161) | static float
  function parse_string_to_keysym_vec (line 172) | static std::vector<KeySym>
  function parse_preset (line 211) | static std::vector<int>
  function parse_cpu_custom_temp_sensor (line 234) | static std::map<std::string, std::string> parse_cpu_custom_temp_sensor(c...
  function parse_fps_sampling_period (line 252) | static uint32_t
  function parse_fps_limit (line 258) | static std::vector<float>
  function parse_fps_limit_method (line 284) | static enum fps_limit_method
  function parse_no_display (line 294) | static bool
  function parse_color (line 300) | static unsigned
  function parse_load_color (line 306) | static std::vector<unsigned>
  function parse_load_value (line 326) | static std::vector<unsigned>
  function parse_str_tokenize (line 340) | static std::vector<std::string>
  function parse_gpu_list (line 354) | static std::vector<unsigned>
  function parse_unsigned (line 371) | static unsigned
  function parse_signed (line 377) | static signed
  function parse_str (line 383) | static std::string
  function parse_path (line 389) | static std::string
  function parse_benchmark_percentiles (line 416) | static std::vector<std::string>
  function parse_font_glyph_ranges (line 424) | static uint32_t
  function gl_size_query (line 455) | static gl_size_query
  function parse_fps_metrics (line 468) | static std::vector<std::string>
  function parse_fex_stats (line 480) | static overlay_params::fex_stats_options
  function parse_ftrace (line 517) | static overlay_params::ftrace_options
  function parse_help (line 648) | static bool
  function is_delimiter (line 668) | static bool is_delimiter(char c)
  function parse_string (line 673) | static int
  function initialize_preset (line 720) | static void
  function set_parameters_from_options (line 731) | static void
  function parse_overlay_env (line 795) | static void
  function set_param_defaults (line 844) | static void set_param_defaults(struct overlay_params *params){
  function verify_pci_dev (line 936) | static std::string verify_pci_dev(std::string pci_dev) {
  function parse_overlay_config (line 959) | void
  function get_params (line 1238) | std::shared_ptr<overlay_params> get_params() {
  function parse_preset_config (line 1246) | bool parse_preset_config(int preset, struct overlay_params *params){
  function add_to_options (line 1290) | void add_to_options(struct overlay_params *params, std::string option, s...
  function presets (line 1295) | void presets(int preset, struct overlay_params *params, bool inherit) {

FILE: src/overlay_params.h
  type KeySym (line 24) | typedef unsigned long KeySym;
  function namespace (line 28) | namespace FTrace {
  type overlay_param_position (line 229) | enum overlay_param_position {
  type overlay_plots (line 242) | enum overlay_plots {
  type font_glyph_ranges (line 247) | enum font_glyph_ranges {
  type gl_size_query (line 259) | enum gl_size_query {
  type fps_limit_method (line 265) | enum fps_limit_method {
  type overlay_transfer_function (line 282) | enum overlay_transfer_function {
  type overlay_params (line 289) | struct overlay_params {
  type gl_size_query (line 309) | enum gl_size_query
  type fex_stats_options (line 371) | struct fex_stats_options {
  function sigbus_counts (line 383) | bool sigbus_counts {true};
  type overlay_params (line 400) | struct overlay_params
  type overlay_params (line 402) | struct overlay_params
  type overlay_params (line 403) | struct overlay_params
  type overlay_params (line 404) | struct overlay_params

FILE: src/pci_ids.cpp
  function parse_pciids (line 24) | void parse_pciids()

FILE: src/pci_ids.h
  type subsys_device (line 8) | struct subsys_device
  type device (line 15) | struct device

FILE: src/real_dlsym.c
  function get_real_functions (line 20) | static void get_real_functions()

FILE: src/shared_x11.cpp
  function init_x11 (line 12) | bool init_x11() {
  function Display (line 61) | Display* get_xdisplay()

FILE: src/shell.h
  function class (line 12) | class Shell {

FILE: src/string_utils.h
  function ltrim (line 23) | static inline void ltrim(std::string &s) {
  function rtrim (line 30) | static inline void rtrim(std::string &s) {
  function trim (line 37) | static inline void trim(std::string &s) {
  function std (line 43) | static inline std::string ltrim_copy(std::string s) {
  function std (line 49) | static inline std::string rtrim_copy(std::string s) {
  function std (line 55) | static inline std::string trim_copy(std::string s) {
  function starts_with (line 60) | static bool starts_with(const std::string& s,  const char *t) {
  function iequal (line 80) | static bool iequal(std::string_view lhs, std::string_view rhs) {
  function std (line 86) | static std::string_view strip_prefix(const std::string_view input, const...
  function std (line 92) | static std::string_view strip_suffix(const std::string_view input, const...
  function try_stoi (line 107) | static bool try_stoi(int& val, const std::string& str)
  function try_stoull (line 114) | static bool try_stoull(unsigned long long& val, const std::string& str)
  function trim_char (line 152) | static void trim_char(char* str) {

FILE: src/timing.hpp
  class MesaClock (line 9) | class MesaClock {
    method time_point (line 16) | static time_point now() noexcept {

FILE: src/vulkan.cpp
  type MangoHud (line 75) | namespace MangoHud { namespace GL {
    type GL (line 75) | namespace GL {
  type instance_data (line 81) | struct instance_data {
    type vk_instance_dispatch_table (line 82) | struct vk_instance_dispatch_table
    type vk_physical_device_dispatch_table (line 83) | struct vk_physical_device_dispatch_table
    type overlay_params (line 85) | struct overlay_params
    type EngineTypes (line 88) | enum EngineTypes
  type queue_data (line 95) | struct queue_data
    type device_data (line 125) | struct device_data
  type device_data (line 96) | struct device_data {
    type instance_data (line 97) | struct instance_data
    type vk_device_dispatch_table (line 101) | struct vk_device_dispatch_table
    type queue_data (line 107) | struct queue_data
    type queue_data (line 109) | struct queue_data
  type command_buffer_data (line 113) | struct command_buffer_data {
    type device_data (line 114) | struct device_data
    type queue_data (line 120) | struct queue_data
  type queue_data (line 124) | struct queue_data {
    type device_data (line 125) | struct device_data
  type overlay_draw (line 132) | struct overlay_draw {
  type swapchain_data (line 150) | struct swapchain_data {
    type device_data (line 151) | struct device_data
    type imgui_contexts (line 183) | struct imgui_contexts
    type swapchain_stats (line 188) | struct swapchain_stats
  function map_object (line 207) | static void map_object(uint64_t obj, void *data)
  function unmap_object (line 213) | static void unmap_object(uint64_t obj)
  function VkBaseInStructure (line 233) | VkBaseInStructure **
  type swapchain_data (line 247) | struct swapchain_data
    type device_data (line 151) | struct device_data
    type imgui_contexts (line 183) | struct imgui_contexts
    type swapchain_stats (line 188) | struct swapchain_stats
  function VkLayerInstanceCreateInfo (line 249) | static VkLayerInstanceCreateInfo *get_instance_chain_info(const VkInstan...
  function VkLayerDeviceCreateInfo (line 261) | static VkLayerDeviceCreateInfo *get_device_chain_info(const VkDeviceCrea...
  type instance_data (line 275) | struct instance_data
    type vk_instance_dispatch_table (line 82) | struct vk_instance_dispatch_table
    type vk_physical_device_dispatch_table (line 83) | struct vk_physical_device_dispatch_table
    type overlay_params (line 85) | struct overlay_params
    type EngineTypes (line 88) | enum EngineTypes
  type instance_data (line 277) | struct instance_data
    type vk_instance_dispatch_table (line 82) | struct vk_instance_dispatch_table
    type vk_physical_device_dispatch_table (line 83) | struct vk_physical_device_dispatch_table
    type overlay_params (line 85) | struct overlay_params
    type EngineTypes (line 88) | enum EngineTypes
  function destroy_instance_data (line 286) | static void destroy_instance_data(struct instance_data *data)
  function instance_data_map_physical_devices (line 294) | static void instance_data_map_physical_devices(struct instance_data *ins...
  type device_data (line 316) | struct device_data
    type instance_data (line 97) | struct instance_data
    type vk_device_dispatch_table (line 101) | struct vk_device_dispatch_table
    type queue_data (line 107) | struct queue_data
    type queue_data (line 109) | struct queue_data
  type instance_data (line 316) | struct instance_data
    type vk_instance_dispatch_table (line 82) | struct vk_instance_dispatch_table
    type vk_physical_device_dispatch_table (line 83) | struct vk_physical_device_dispatch_table
    type overlay_params (line 85) | struct overlay_params
    type EngineTypes (line 88) | enum EngineTypes
  type device_data (line 318) | struct device_data
    type instance_data (line 97) | struct instance_data
    type vk_device_dispatch_table (line 101) | struct vk_device_dispatch_table
    type queue_data (line 107) | struct queue_data
    type queue_data (line 109) | struct queue_data
  type queue_data (line 325) | struct queue_data
    type device_data (line 125) | struct device_data
  type device_data (line 328) | struct device_data
    type instance_data (line 97) | struct instance_data
    type vk_device_dispatch_table (line 101) | struct vk_device_dispatch_table
    type queue_data (line 107) | struct queue_data
    type queue_data (line 109) | struct queue_data
  type queue_data (line 330) | struct queue_data
    type device_data (line 125) | struct device_data
  function destroy_queue (line 343) | static void destroy_queue(struct queue_data *data)
  function device_map_queues (line 349) | static void device_map_queues(struct device_data *data,
  function device_unmap_queues (line 384) | static void device_unmap_queues(struct device_data *data)
  function destroy_device_data (line 390) | static void destroy_device_data(struct device_data *data)
  type command_buffer_data (line 397) | struct command_buffer_data
    type device_data (line 114) | struct device_data
    type queue_data (line 120) | struct queue_data
  type device_data (line 399) | struct device_data
    type instance_data (line 97) | struct instance_data
    type vk_device_dispatch_table (line 101) | struct vk_device_dispatch_table
    type queue_data (line 107) | struct queue_data
    type queue_data (line 109) | struct queue_data
  type command_buffer_data (line 401) | struct command_buffer_data
    type device_data (line 114) | struct device_data
    type queue_data (line 120) | struct queue_data
  function destroy_command_buffer_data (line 409) | static void destroy_command_buffer_data(struct command_buffer_data *data)
  type swapchain_data (line 416) | struct swapchain_data
    type device_data (line 151) | struct device_data
    type imgui_contexts (line 183) | struct imgui_contexts
    type swapchain_stats (line 188) | struct swapchain_stats
  type device_data (line 417) | struct device_data
    type instance_data (line 97) | struct instance_data
    type vk_device_dispatch_table (line 101) | struct vk_device_dispatch_table
    type queue_data (line 107) | struct queue_data
    type queue_data (line 109) | struct queue_data
  type instance_data (line 419) | struct instance_data
    type vk_instance_dispatch_table (line 82) | struct vk_instance_dispatch_table
    type vk_physical_device_dispatch_table (line 83) | struct vk_physical_device_dispatch_table
    type overlay_params (line 85) | struct overlay_params
    type EngineTypes (line 88) | enum EngineTypes
  type swapchain_data (line 420) | struct swapchain_data
    type device_data (line 151) | struct device_data
    type imgui_contexts (line 183) | struct imgui_contexts
    type swapchain_stats (line 188) | struct swapchain_stats
  function destroy_swapchain_data (line 429) | static void destroy_swapchain_data(struct swapchain_data *data)
  type overlay_draw (line 435) | struct overlay_draw
  type swapchain_data (line 435) | struct swapchain_data
    type device_data (line 151) | struct device_data
    type imgui_contexts (line 183) | struct imgui_contexts
    type swapchain_stats (line 188) | struct swapchain_stats
  type device_data (line 437) | struct device_data
    type instance_data (line 97) | struct instance_data
    type vk_device_dispatch_table (line 101) | struct vk_device_dispatch_table
    type queue_data (line 107) | struct queue_data
    type queue_data (line 109) | struct queue_data
  type overlay_draw (line 442) | struct overlay_draw
  function snapshot_swapchain_frame (line 486) | static void snapshot_swapchain_frame(struct swapchain_data *data)
  function compute_swapchain_display (line 500) | static void compute_swapchain_display(struct swapchain_data *data)
  function vk_memory_type (line 528) | static uint32_t vk_memory_type(struct device_data *data,
  function update_image_descriptor (line 540) | static void update_image_descriptor(struct swapchain_data *data, VkImage...
  function upload_image_data (line 557) | static void upload_image_data(struct device_data *device_data,
  function create_image (line 658) | static void create_image(struct swapchain_data *data,
  function VkDescriptorSet (line 715) | static VkDescriptorSet create_image_with_desc(struct swapchain_data *data,
  function check_fonts (line 740) | static void check_fonts(struct swapchain_data* data)
  function ensure_swapchain_fonts (line 771) | static void ensure_swapchain_fonts(struct swapchain_data *data,
  function CreateOrResizeBuffer (line 789) | static void CreateOrResizeBuffer(struct device_data *data,
  type overlay_draw (line 826) | struct overlay_draw
  type swapchain_data (line 826) | struct swapchain_data
    type device_data (line 151) | struct device_data
    type imgui_contexts (line 183) | struct imgui_contexts
    type swapchain_stats (line 188) | struct swapchain_stats
  type queue_data (line 827) | struct queue_data
    type device_data (line 125) | struct device_data
  type device_data (line 836) | struct device_data
    type instance_data (line 97) | struct instance_data
    type vk_device_dispatch_table (line 101) | struct vk_device_dispatch_table
    type queue_data (line 107) | struct queue_data
    type queue_data (line 109) | struct queue_data
  type overlay_draw (line 844) | struct overlay_draw
  function setup_swapchain_data_pipeline (line 1101) | static void setup_swapchain_data_pipeline(struct swapchain_data *data)
  function convert_colors_vk (line 1301) | static void convert_colors_vk(VkFormat format, VkColorSpaceKHR colorspac...
  function setup_swapchain_data (line 1365) | static void setup_swapchain_data(struct swapchain_data *data,
  function shutdown_swapchain_font (line 1487) | static void shutdown_swapchain_font(struct swapchain_data *data)
  function shutdown_swapchain_data (line 1499) | static void shutdown_swapchain_data(struct swapchain_data *data)
  type overlay_draw (line 1540) | struct overlay_draw
  type swapchain_data (line 1540) | struct swapchain_data
    type device_data (line 151) | struct device_data
    type imgui_contexts (line 183) | struct imgui_contexts
    type swapchain_stats (line 188) | struct swapchain_stats
  type queue_data (line 1541) | struct queue_data
    type device_data (line 125) | struct device_data
  type overlay_draw (line 1546) | struct overlay_draw
  function is_present_mode_supported (line 1560) | static bool is_present_mode_supported(VkPhysicalDevice device, VkSurface...
  function VkResult (line 1591) | static VkResult overlay_CreateSwapchainKHR(
  function overlay_DestroySwapchainKHR (line 1667) | static void overlay_DestroySwapchainKHR(
  function VkResult (line 1686) | static VkResult overlay_QueuePresentKHR(
  function VkResult (line 1766) | static VkResult overlay_BeginCommandBuffer(
  function VkResult (line 1780) | static VkResult overlay_EndCommandBuffer(
  function VkResult (line 1790) | static VkResult overlay_ResetCommandBuffer(
  function overlay_CmdExecuteCommands (line 1801) | static void overlay_CmdExecuteCommands(
  function VkResult (line 1813) | static VkResult overlay_AllocateCommandBuffers(
  function overlay_FreeCommandBuffers (line 1832) | static void overlay_FreeCommandBuffers(
  function VkResult (line 1854) | static VkResult overlay_QueueSubmit(
  function VkResult (line 1866) | static VkResult overlay_CreateDevice(
  function overlay_DestroyDevice (line 1965) | static void overlay_DestroyDevice(
  function VkResult (line 1976) | static VkResult overlay_CreateInstance(
  function VkResult (line 2078) | static VkResult overlay_CreateSampler(
  function overlay_DestroyInstance (line 2120) | static void overlay_DestroyInstance(
  function VkResult (line 2135) | static VkResult overlay_CreateWaylandSurfaceKHR(
  function overlay_DestroySurfaceKHR (line 2151) | static void overlay_DestroySurfaceKHR(
  function PUBLIC (line 2220) | PUBLIC VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL overlay_GetDeviceProcAdd...
  function PUBLIC (line 2234) | PUBLIC VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL overlay_GetInstanceProcA...

FILE: src/wayland_hook.h
  type KeySym (line 6) | typedef unsigned long KeySym;
  type wl_display (line 11) | struct wl_display
  type wl_display (line 13) | struct wl_display
  type wl_display (line 14) | struct wl_display

FILE: src/wayland_keybinds.cpp
  type xkb_context (line 16) | struct xkb_context
  type wayland_display (line 18) | struct wayland_display
    type wl_event_queue (line 21) | struct wl_event_queue
    type wl_seat (line 22) | struct wl_seat
    type wl_keyboard (line 23) | struct wl_keyboard
    type xkb_keymap (line 24) | struct xkb_keymap
    type xkb_state (line 25) | struct xkb_state
    method wayland_display (line 29) | wayland_display()
  type wl_display (line 53) | struct wl_display
  type wl_seat (line 65) | struct wl_seat
  function seat_handle_name (line 66) | static void seat_handle_name(void *data, struct wl_seat *seat, const cha...
  type wl_seat_listener (line 68) | struct wl_seat_listener
  function registry_handle_global (line 73) | static void registry_handle_global(void *data, struct wl_registry* regis...
  function registry_handle_global_remove (line 84) | static void registry_handle_global_remove(void *data, struct wl_registry...
  function wl_keyboard_keymap (line 86) | static void wl_keyboard_keymap(void *data, struct wl_keyboard *wl_keyboa...
  function wl_keyboard_enter (line 112) | static void wl_keyboard_enter(void *data, struct wl_keyboard *wl_keyboar...
  function wl_keyboard_leave (line 129) | static void wl_keyboard_leave(void *data, struct wl_keyboard *wl_keyboar...
  function wl_keyboard_key (line 135) | static void wl_keyboard_key(void *data, struct wl_keyboard *wl_keyboard,...
  function wl_keyboard_modifiers (line 150) | static void wl_keyboard_modifiers(void *data, struct wl_keyboard *wl_key...
  function wl_keyboard_repeat_info (line 162) | static void wl_keyboard_repeat_info(void *data, struct wl_keyboard *wl_k...
  type wl_registry_listener (line 164) | struct wl_registry_listener
  type wl_keyboard_listener (line 169) | struct wl_keyboard_listener
  function seat_handle_capabilities (line 178) | static void seat_handle_capabilities(void *data, struct wl_seat *seat, u...
  function update_wl_queue (line 193) | void update_wl_queue()
  function init_wayland_data (line 200) | void init_wayland_data(struct wl_display *display, void *vk_surface)
  function wayland_data_unref (line 237) | void wayland_data_unref(struct wl_display *display, void *vk_surface)
  function has_wayland_display (line 264) | bool has_wayland_display(struct wl_display *display)
  function wayland_has_keys_pressed (line 269) | bool wayland_has_keys_pressed(const std::vector<KeySym>& keys)

FILE: src/win/d3d11_hook.h
  function namespace (line 5) | namespace impl

FILE: src/win/d3d12_hook.cpp
  function hkPresent12 (line 11) | long __fastcall hkPresent12(IDXGISwapChain3* pSwapChain, UINT SyncInterv...

FILE: src/win/d3d12_hook.h
  function namespace (line 13) | namespace impl

FILE: src/win/d3d_shared.cpp
  type swapchain_stats (line 7) | struct swapchain_stats
  function init_d3d_shared (line 11) | void init_d3d_shared(){
  function d3d_run (line 21) | void d3d_run(){

FILE: src/win/d3d_shared.h
  type overlay_params (line 6) | struct overlay_params
  type swapchain_stats (line 7) | struct swapchain_stats

FILE: src/win/dxgi.cpp
  function get_device_id_dxgi (line 13) | uint32_t get_device_id_dxgi(){

FILE: src/win/kiero.cpp
  function uint150_t (line 693) | uint150_t* kiero::getMethodsTable()

FILE: src/win/kiero.h
  type uint150_t (line 28) | typedef uint64_t uint150_t;
  type uint150_t (line 30) | typedef uint32_t uint150_t;
  function namespace (line 33) | namespace kiero

FILE: src/win/main.cpp
  function ConsoleSetup (line 20) | void ConsoleSetup()
  function renderTypes (line 30) | void renderTypes() {
  function MainThread (line 56) | int MainThread()
  function BOOL (line 69) | BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID)

FILE: tests/params.py
  class Test (line 4) | class Test:
    method __init__ (line 5) | def __init__(self):
    method get_options (line 20) | def get_options(self):
    method find_options_in_readme (line 34) | def find_options_in_readme(self):
    method find_options_in_conf (line 42) | def find_options_in_conf(self):
    method get_param_defaults (line 73) | def get_param_defaults(self):

FILE: tests/test_amdgpu.cpp
  function test_amdgpu_verify_metrics (line 13) | static void test_amdgpu_verify_metrics(void **state) {
  function test_amdgpu_get_instant_metrics (line 23) | static void test_amdgpu_get_instant_metrics(void **state) {
  function test_amdgpu_get_samples_and_copy (line 76) | static void test_amdgpu_get_samples_and_copy(void **state) {
  function test_amdgpu_get_metrics (line 87) | static void test_amdgpu_get_metrics(void **state) {
  type CMUnitTest (line 94) | struct CMUnitTest
  function main (line 101) | int main(void) {
Condensed preview — 187 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,447K chars).
[
  {
    "path": ".editorconfig",
    "chars": 611,
    "preview": "# See http://editorconfig.org to read about the EditorConfig format.\n# - Automatically supported by VS2017+ and most com"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/-bug-report----issue.md",
    "chars": 971,
    "preview": "---\nname: \"[Bug report] - Issue\"\nabout: Create a report to help us improve\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n\n⚠️ "
  },
  {
    "path": ".github/dependabot.yml",
    "chars": 118,
    "preview": "version: 2\nupdates:\n  - package-ecosystem: \"github-actions\"\n    directory: \"/\"\n    schedule:\n      interval: \"weekly\"\n"
  },
  {
    "path": ".github/workflows/arch-package.yml",
    "chars": 1555,
    "preview": "name: arch package\n\non:\n  workflow_dispatch:\n\njobs:\n  build-arch-pkg:\n    runs-on: ubuntu-latest\n    container:\n      im"
  },
  {
    "path": ".github/workflows/build-package.yml",
    "chars": 2537,
    "preview": "name: Build release package\non:\n  release:\n    types: [published]\n\njobs:\n  build:\n    runs-on: ubuntu-24.04\n\n    steps:\n"
  },
  {
    "path": ".github/workflows/build-source.yml",
    "chars": 1263,
    "preview": "name: Build source tars\non:\n  workflow_dispatch:\n  release:\n    types: [published]\n\njobs:\n  build:\n    runs-on: ubuntu-l"
  },
  {
    "path": ".github/workflows/mingw.yml",
    "chars": 468,
    "preview": "name: Mingw build testing\n\non: [push, pull_request]\njobs:\n  build-mingw:\n    runs-on: ubuntu-latest\n    container:\n     "
  },
  {
    "path": ".github/workflows/param-check.yml",
    "chars": 485,
    "preview": "name: param check\n\non:\n  push:\n    paths:\n      - 'src/overlay_params.h'\n      - 'README.md'\n      - 'data/MangoHud.conf"
  },
  {
    "path": ".github/workflows/ubuntu.yml",
    "chars": 1633,
    "preview": "name: Ubuntu build testing\n\non: [push, pull_request]\n\njobs:\n  build-test:\n    strategy:\n      matrix:\n        compiler: "
  },
  {
    "path": ".gitignore",
    "chars": 602,
    "preview": "build\nbuilddir\n__pycache__\n.vscode\nMangoHud*.tar.*\npkg\nmangohud*.tar.*\nlib32-mangohud*.tar.*\n\n# Prerequisites\n*.d\n\n# Com"
  },
  {
    "path": ".gitmodules",
    "chars": 104,
    "preview": "[submodule \"modules/minhook\"]\n\tpath = modules/minhook\n\turl = https://github.com/flightlessmango/minhook\n"
  },
  {
    "path": "LICENSE",
    "chars": 1072,
    "preview": "MIT License\n\nCopyright (c) 2020 flightlessmango\n\nPermission is hereby granted, free of charge, to any person obtaining a"
  },
  {
    "path": "README.md",
    "chars": 38701,
    "preview": "# MangoHud\n\nA Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more.\n\n![Example gif showing "
  },
  {
    "path": "bin/gen_enum_to_str.py",
    "chars": 19020,
    "preview": "# Copyright © 2017 Intel Corporation\n\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# o"
  },
  {
    "path": "bin/mangohud-setup.sh",
    "chars": 4771,
    "preview": "#!/usr/bin/env bash\nOS_RELEASE_FILES=(\"/etc/os-release\" \"/usr/lib/os-release\")\nXDG_CONFIG_HOME=\"${XDG_CONFIG_HOME:-$HOME"
  },
  {
    "path": "bin/mangohud.in",
    "chars": 1441,
    "preview": "#!/bin/sh\n\nif [ \"$#\" -eq 0 ]; then\n    programname=$(basename \"$0\")\n    echo \"ERROR: No program supplied\"\n    echo\n    e"
  },
  {
    "path": "bin/mangoplot.py",
    "chars": 13924,
    "preview": "#!/usr/bin/env python\n\nr\"\"\"\n    Script to plot all the MangoHud benchmarks contained in a given folder.\n\"\"\"\nfrom pathlib"
  },
  {
    "path": "bin/meson.build",
    "chars": 201,
    "preview": "# runtime dependencies for `mangoplot`: matplotlib and a GUI backed like PyQt5\ninstall_data(\n  'mangoplot.py',\n  install"
  },
  {
    "path": "bin/vk_dispatch_table_gen.py",
    "chars": 26197,
    "preview": "COPYRIGHT = \"\"\"\\\n/*\n * Copyright 2020 Intel Corporation\n *\n * Permission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "bin/vk_entrypoints.py",
    "chars": 4943,
    "preview": "# Copyright 2020 Intel Corporation\n#\n# Permission is hereby granted, free of charge, to any person obtaining a\n# copy of"
  },
  {
    "path": "bin/vk_extensions.py",
    "chars": 13856,
    "preview": "import copy\nimport re\nimport xml.etree.ElementTree as et\n\ndef get_api_list(s):\n    apis = []\n    for a in s.split(','):\n"
  },
  {
    "path": "bin/vk_extensions_gen.py",
    "chars": 4626,
    "preview": "COPYRIGHT = \"\"\"\\\n/*\n * Copyright 2017 Intel Corporation\n *\n * Permission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "build-source.sh",
    "chars": 1072,
    "preview": "#!/bin/sh\n\nVERSION=$(git describe --tags --dirty)\nNAME=MangoHud-${VERSION}\nTAR_NAME=${NAME}-Source.tar.xz\nDFSG_TAR_NAME="
  },
  {
    "path": "build-srt.sh",
    "chars": 5425,
    "preview": "#!/usr/bin/env bash\n# Specialized build script for Steam Runtime SDK docker\nset -e\n\nIFS=\" \" read -ra debian_chroot < /et"
  },
  {
    "path": "build-with-srt-docker.sh",
    "chars": 1500,
    "preview": "#!/usr/bin/env bash\n# Usage example: $0 master soldier 0.20210618.0\nset -u\n\nif [ $# -eq 2 ]; then\n  echo Specify runtime"
  },
  {
    "path": "build.sh",
    "chars": 13174,
    "preview": "#!/usr/bin/env bash\nset -e\n\n# Import the variables for dependencies\nsource ./build_deps.sh\n\nOS_RELEASE_FILES=(\"/etc/os-r"
  },
  {
    "path": "build_deps.sh",
    "chars": 1111,
    "preview": "DEPS_ARCH=\"gcc,meson,pkgconf,python-mako,glslang,libglvnd,lib32-libglvnd,libxnvctrl,libdrm,python-numpy,python-matplotli"
  },
  {
    "path": "control/setup.cfg",
    "chars": 516,
    "preview": "[metadata]\nname = mangohud_control\nversion = 0.0.1\nauthor = Simon Hallsten\nauthor_email = flightlessmangoyt@gmail.com\nde"
  },
  {
    "path": "control/setup.py",
    "chars": 188,
    "preview": "import site\nimport sys\nfrom setuptools import setup\n\nif __name__ == \"__main__\":\n    setup()\n\n# See https://github.com/py"
  },
  {
    "path": "control/src/control/__init__.py",
    "chars": 6444,
    "preview": "#!/usr/bin/env python3\nimport os\nimport socket\nimport sys\nimport select\nfrom select import EPOLLIN, EPOLLPRI, EPOLLERR\ni"
  },
  {
    "path": "data/MangoHud.conf",
    "chars": 11719,
    "preview": "### MangoHud configuration file\n### Uncomment any options you wish to enable. Default options are left uncommented\n### U"
  },
  {
    "path": "data/io.github.flightlessmango.mangohud.metainfo.xml",
    "chars": 1566,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<component type=\"generic\">\n  <id>io.github.flightlessmango.mangohud</id>\n\n  <name"
  },
  {
    "path": "data/mangoapp.1",
    "chars": 1236,
    "preview": ".\\\" Manpage for mangoapp.\n.TH mangoapp 1 \"\" \"\" \"mangoapp\"\n\n.SH NAME\nmangoapp \\- transparent background application with "
  },
  {
    "path": "data/mangohud.1",
    "chars": 1944,
    "preview": ".\\\" Manpage for mangohud.\n.TH mangohud 1 \"\" \"\" \"mangohud\"\n\n.SH NAME\nmangohud \\- enable MangoHud on any application\n\n.SH "
  },
  {
    "path": "data/meson.build",
    "chars": 1322,
    "preview": "man1dir = join_paths(get_option('mandir'), 'man1')\ndatadir = get_option('datadir')\nmetainfo_file = files('io.github.flig"
  },
  {
    "path": "data/presets.conf",
    "chars": 101,
    "preview": "[preset 1]\nno_display\n\n[preset 2]\nlegacy_layout=0\ncpu_stats=0\ngpu_stats=0\nfps\nfps_only=1\nframetime=0\n"
  },
  {
    "path": "include/.editorconfig",
    "chars": 34,
    "preview": "# ignore this folder\nroot = true\n\n"
  },
  {
    "path": "include/IconsForkAwesome.h",
    "chars": 41134,
    "preview": "// Generated by https://github.com/juliettef/IconFontCppHeaders script GenerateIconFontCppHeaders.py for languages C and"
  },
  {
    "path": "include/KHR/khrplatform.h",
    "chars": 10277,
    "preview": "#ifndef __khrplatform_h_\n#define __khrplatform_h_\n\n/*\n** Copyright (c) 2008-2018 The Khronos Group Inc.\n**\n** Permission"
  },
  {
    "path": "include/elfhacks.h",
    "chars": 5438,
    "preview": "/**\n * \\file src/elfhacks.h\n * \\brief elfhacks application interface\n * \\author Pyry Haulos <pyry.haulos@gmail.com>\n * \\"
  },
  {
    "path": "include/filesystem.h",
    "chars": 184596,
    "preview": "//---------------------------------------------------------------------------------------\n//\n// ghc::filesystem - A C++1"
  },
  {
    "path": "include/glad/glad.h",
    "chars": 287256,
    "preview": "/*\n\n    OpenGL, OpenGL ES loader generated by glad 0.1.33 on Thu Apr  9 12:37:38 2020.\n\n    Language/Generator: C/C++\n  "
  },
  {
    "path": "include/nvml.h",
    "chars": 342883,
    "preview": "/*\n * Copyright 1993-2019 NVIDIA Corporation.  All rights reserved.\n *\n * NOTICE TO USER:   \n *\n * This source code is s"
  },
  {
    "path": "include/vulkan/vk_util.h",
    "chars": 6317,
    "preview": "/*\n * Copyright © 2017 Intel Corporation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n "
  },
  {
    "path": "meson.build",
    "chars": 9181,
    "preview": "project('MangoHud',\n  ['c', 'cpp'],\n  version : 'v0.8.3',\n  license : 'MIT',\n  meson_version: '>=0.60.0',\n  default_opti"
  },
  {
    "path": "meson_options.txt",
    "chars": 1401,
    "preview": "option('glibcxx_asserts', type : 'boolean', value : false)\noption('use_system_spdlog', type : 'feature', value : 'disabl"
  },
  {
    "path": "mingw32.txt",
    "chars": 313,
    "preview": "[binaries]\nc = 'i686-w64-mingw32-gcc'\ncpp = 'i686-w64-mingw32-g++'\nar = 'i686-w64-mingw32-ar'\nstrip = 'i686-w64-mingw32-"
  },
  {
    "path": "mingw64.txt",
    "chars": 328,
    "preview": "[binaries]\nc = 'x86_64-w64-mingw32-gcc'\ncpp = 'x86_64-w64-mingw32-g++'\nar = 'x86_64-w64-mingw32-ar'\nstrip = 'x86_64-w64-"
  },
  {
    "path": "pkgbuild/PKGBUILD",
    "chars": 3969,
    "preview": "# Maintainer: Simon Hallsten <flightlessmangoyt@gmail.com>\n\npkgname=('mangohud' 'lib32-mangohud')\npkgver=0.8.3.rc1.r36.g"
  },
  {
    "path": "src/amdgpu.cpp",
    "chars": 18406,
    "preview": "#include <spdlog/spdlog.h>\n#include <thread>\n#ifdef __linux__\n#include <sys/sysinfo.h>\n#endif\n#include \"amdgpu.h\"\n#inclu"
  },
  {
    "path": "src/amdgpu.h",
    "chars": 12361,
    "preview": "#pragma once\n#include <stdio.h>\n#include <inttypes.h>\n#include <unistd.h>\n#include <string>\n#include \"overlay_params.h\"\n"
  },
  {
    "path": "src/app/control.c",
    "chars": 2261,
    "preview": "#include <sys/ipc.h>\n#include <sys/msg.h>\n#include <string.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <stdbool.h"
  },
  {
    "path": "src/app/main.cpp",
    "chars": 16955,
    "preview": "// Dear ImGui: standalone example application for GLFW + OpenGL 3, using programmable pipeline\n// (GLFW is a cross-platf"
  },
  {
    "path": "src/app/mangoapp.h",
    "chars": 173,
    "preview": "#pragma once\n#include <stdint.h>\n#include <mutex>\n#include <condition_variable>\n#include <vector>\n\nextern std::mutex man"
  },
  {
    "path": "src/app/mangoapp_proto.h",
    "chars": 1540,
    "preview": "#include <stdint.h>\n\nstruct mangoapp_msg_header {\n    long msg_type;  // Message queue ID, never change\n    uint32_t ver"
  },
  {
    "path": "src/battery.cpp",
    "chars": 7279,
    "preview": "#include <spdlog/spdlog.h>\n#include <filesystem.h>\n#include \"battery.h\"\n\nnamespace fs = ghc::filesystem;\nusing namespace"
  },
  {
    "path": "src/battery.h",
    "chars": 550,
    "preview": "#pragma once\n#include <string>\n\nclass BatteryStats{\n    public:\n        void numBattery();\n        void update();\n      "
  },
  {
    "path": "src/blacklist.cpp",
    "chars": 2781,
    "preview": "#include <vector>\n#include <string>\n#include <algorithm>\n#include <spdlog/spdlog.h>\n#include <filesystem.h>\n\n#include \"b"
  },
  {
    "path": "src/blacklist.h",
    "chars": 289,
    "preview": "#pragma once\n#ifndef MANGOHUD_BLACKLIST_H\n#define MANGOHUD_BLACKLIST_H\n#include<string>\nbool is_blacklisted(bool force_r"
  },
  {
    "path": "src/config.cpp",
    "chars": 3563,
    "preview": "#include <fstream>\n#include <sstream>\n#include <iostream>\n#include <string.h>\n#include <thread>\n#include <unordered_map>"
  },
  {
    "path": "src/config.h",
    "chars": 308,
    "preview": "#pragma once\n#ifndef MANGOHUD_CONFIG_H\n#define MANGOHUD_CONFIG_H\n\n#include \"overlay_params.h\"\n#include <string>\n\nvoid pa"
  },
  {
    "path": "src/control.cpp",
    "chars": 5964,
    "preview": "#include <cstdint>\n#include <assert.h>\n#include <cerrno>\n#include <cstring>\n#include <sys/socket.h>\n#include \"mesa/util/"
  },
  {
    "path": "src/cpu.cpp",
    "chars": 29373,
    "preview": "#include \"cpu.h\"\n#include <memory>\n#include <string>\n#include <iostream>\n#include <fstream>\n#include <sstream>\n#include "
  },
  {
    "path": "src/cpu.h",
    "chars": 5816,
    "preview": "#pragma once\n#ifndef MANGOHUD_CPU_H\n#define MANGOHUD_CPU_H\n\n#include <vector>\n#include <cstdint>\n#include <cstdio>\n#incl"
  },
  {
    "path": "src/cpu_win32.cpp",
    "chars": 1950,
    "preview": "#include <windows.h>\n#include <thread>\n#include <string.h>\n#include \"cpu.h\"\n#include <iostream>\n#define SystemProcessorP"
  },
  {
    "path": "src/dbus.cpp",
    "chars": 15861,
    "preview": "#include <array>\n#include <cstdio>\n#include <iostream>\n#include <sstream>\n\n#include \"dbus_helpers.h\"\n#include \"dbus_info"
  },
  {
    "path": "src/dbus_helpers.h",
    "chars": 12289,
    "preview": "#pragma once\n#ifndef MANGOHUD_DBUS_HELPERS\n#define MANGOHUD_DBUS_HELPERS\n\n#include <vector>\n#include <spdlog/spdlog.h>\n#"
  },
  {
    "path": "src/dbus_info.h",
    "chars": 3868,
    "preview": "#pragma once\n#ifndef MANGOHUD_DBUS_INFO_H\n#define MANGOHUD_DBUS_INFO_H\n\n#ifdef HAVE_DBUS\n\n#include <array>\n#include <fun"
  },
  {
    "path": "src/device.cpp",
    "chars": 8186,
    "preview": "#include \"device.h\"\n#include <filesystem.h>\n#include <iostream>\n#include <algorithm>\n#include <spdlog/spdlog.h>\n\nnamespa"
  },
  {
    "path": "src/device.h",
    "chars": 532,
    "preview": "#pragma once\n#ifndef MANGOHUD_DEVICE_H\n#define MANGOHUD_DEVICE_H\n#include <vector>\n#include <string>\n#include \"overlay_p"
  },
  {
    "path": "src/elfhacks.c",
    "chars": 14471,
    "preview": "/**\n * \\file src/elfhacks.c\n * \\brief various ELF run-time hacks\n * \\author Pyry Haulos <pyry.haulos@gmail.com>\n * \\date"
  },
  {
    "path": "src/fcat.h",
    "chars": 2252,
    "preview": "#pragma once\n#ifndef MANGOHUD_FCAT_H\n#define MANGOHUD_FCAT_H\n\n#include <iostream>\n#include <vector>\n#include <fstream>\n#"
  },
  {
    "path": "src/fex.cpp",
    "chars": 15887,
    "preview": "#include <spdlog/spdlog.h>\n#include <map>\n#include <string>\n#include <unistd.h>\n#include <sys/mman.h>\n\n#include \"fex.h\"\n"
  },
  {
    "path": "src/fex.h",
    "chars": 1768,
    "preview": "#pragma once\n#ifdef HAVE_FEX\n#ifndef MANGOHUD_FEX_H\n#define MANGOHUD_FEX_H\n#include <cstdint>\n#include <vector>\n#include"
  },
  {
    "path": "src/file_utils.cpp",
    "chars": 5659,
    "preview": "#include \"file_utils.h\"\n#include \"string_utils.h\"\n#include <sys/types.h>\n#include <sys/stat.h>\n#include <unistd.h>\n#incl"
  },
  {
    "path": "src/file_utils.h",
    "chars": 1040,
    "preview": "#pragma once\n#ifndef MANGOHUD_FILE_UTILS_H\n#define MANGOHUD_FILE_UTILS_H\n\n#include <string>\n#include <vector>\n#include <"
  },
  {
    "path": "src/file_utils_win32.cpp",
    "chars": 704,
    "preview": "#include \"file_utils.h\"\n#include \"string_utils.h\"\n#include <fstream>\n#include <string>\n\nstd::vector<std::string> ls(cons"
  },
  {
    "path": "src/font.cpp",
    "chars": 5725,
    "preview": "#include <cstdint>\n#include \"overlay.h\"\n#include \"file_utils.h\"\n#include \"font_default.h\"\n#include \"IconsForkAwesome.h\"\n"
  },
  {
    "path": "src/font_default.h",
    "chars": 239,
    "preview": "#pragma once\n#ifndef MANGOHUD_FONT_DEFAULT_H\n#define MANGOHUD_FONT_DEFAULT_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nco"
  },
  {
    "path": "src/font_unispace.c",
    "chars": 42866,
    "preview": "#include \"font_default.h\"\n\nstatic const char ttf_compressed_data_base85[178490+1] =\n    \"7])########0tO6'/###W),##1xL$#Q"
  },
  {
    "path": "src/forkawesome.h",
    "chars": 225854,
    "preview": "// File: 'forkawesome-webfont.ttf' (218132 bytes)\n// Exported using binary_to_compressed_c.cpp\n#pragma once\n\nstatic cons"
  },
  {
    "path": "src/fps_limiter.h",
    "chars": 2391,
    "preview": "#pragma once\n#include \"overlay_params.h\"\n#include <mesa/util/os_time.h>\n\nclass fpsLimiter {\n    private:\n        int64_t"
  },
  {
    "path": "src/fps_metrics.h",
    "chars": 5404,
    "preview": "#pragma once\n#include <vector>\n#include <string>\n#include <memory>\n#include <thread>\n#include <mesa/util/os_time.h>\n#inc"
  },
  {
    "path": "src/ftrace.cpp",
    "chars": 7595,
    "preview": "#include \"ftrace.h\"\n\n#ifdef HAVE_FTRACE\n\n#include <algorithm>\n#include <climits>\n#include <fcntl.h>\n#include <poll.h>\n#i"
  },
  {
    "path": "src/ftrace.h",
    "chars": 1640,
    "preview": "#pragma once\n\n#ifdef HAVE_FTRACE\n\n#include <array>\n#include <atomic>\n#include <memory>\n#include <thread>\n#include <unord"
  },
  {
    "path": "src/gl/gl.h",
    "chars": 1321,
    "preview": "#pragma once\n#ifndef MANGOHUD_GL_GL_H\n#define MANGOHUD_GL_GL_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif //__cplusplus\n\nvo"
  },
  {
    "path": "src/gl/gl_hud.cpp",
    "chars": 7357,
    "preview": "#include <cstdlib>\n#include <functional>\n#include <thread>\n#include <string>\n#include <iostream>\n#include <sstream>\n#inc"
  },
  {
    "path": "src/gl/gl_hud.h",
    "chars": 483,
    "preview": "#pragma once\n#ifndef MANGOHUD_GL_IMGUI_HUD_H\n#define MANGOHUD_GL_IMGUI_HUD_H\n\n#include \"overlay.h\"\n#include \"gl_renderer"
  },
  {
    "path": "src/gl/gl_renderer.cpp",
    "chars": 33725,
    "preview": "// dear imgui: Renderer for modern OpenGL with shaders / programmatic pipeline\n// - Desktop GL: 2.x 3.x 4.x\n// - Embedde"
  },
  {
    "path": "src/gl/gl_renderer.h",
    "chars": 3049,
    "preview": "// dear imgui: Renderer for modern OpenGL with shaders / programmatic pipeline\n// - Desktop GL: 2.x 3.x 4.x\n// - Embedde"
  },
  {
    "path": "src/gl/glad.c",
    "chars": 184672,
    "preview": "/*\n\n    OpenGL, OpenGL ES loader generated by glad 0.1.33 on Thu Apr  9 12:37:38 2020.\n\n    Language/Generator: C/C++\n  "
  },
  {
    "path": "src/gl/inject_egl.cpp",
    "chars": 8897,
    "preview": "#include <iostream>\n#include <array>\n#include <unordered_map>\n#include <cstring>\n#include <dlfcn.h>\n#include <chrono>\n#i"
  },
  {
    "path": "src/gl/inject_glx.cpp",
    "chars": 10454,
    "preview": "#include <X11/Xlib.h>\n#include <iostream>\n#include <array>\n#include <thread>\n#include <vector>\n#include <unordered_map>\n"
  },
  {
    "path": "src/gl/shim.c",
    "chars": 9328,
    "preview": "#include <dlfcn.h>\n#include <errno.h>\n#include <link.h>\n#include <stdio.h>\n#include <stdint.h>\n#include \"gl.h\"\n#include "
  },
  {
    "path": "src/gpu.cpp",
    "chars": 6886,
    "preview": "#include \"gpu.h\"\n#include \"file_utils.h\"\n#include \"hud_elements.h\"\n\nnamespace fs = ghc::filesystem;\n\nGPUS::GPUS(const ov"
  },
  {
    "path": "src/gpu.h",
    "chars": 5826,
    "preview": "#pragma once\n#ifndef MANGOHUD_GPU_H\n#define MANGOHUD_GPU_H\n\n#include <cstdio>\n#include <cstdint>\n#include \"overlay_param"
  },
  {
    "path": "src/gpu_fdinfo.cpp",
    "chars": 20816,
    "preview": "#include \"gpu_fdinfo.h\"\n\n#ifndef TEST_ONLY\n#include \"hud_elements.h\"\n#endif\n\nnamespace fs = ghc::filesystem;\n\nvoid GPU_f"
  },
  {
    "path": "src/gpu_fdinfo.h",
    "chars": 7574,
    "preview": "#pragma once\n\n#include <inttypes.h>\n#include <sys/stat.h>\n#include <sys/types.h>\n#include <unistd.h>\n\n#include <cstdint>"
  },
  {
    "path": "src/gpu_metrics_util.h",
    "chars": 3536,
    "preview": "#pragma once\n#include <atomic>\n\nstruct gpu_metrics {\n    int load;\n    int temp;\n    int junction_temp {-1};\n    int mem"
  },
  {
    "path": "src/hud_elements.cpp",
    "chars": 94878,
    "preview": "#include <spdlog/spdlog.h>\n#include <algorithm>\n#include <functional>\n#include <sstream>\n#include <cmath>\n#include <map>"
  },
  {
    "path": "src/hud_elements.h",
    "chars": 5618,
    "preview": "#pragma once\n#include <vector>\n#include <string>\n#include <utility>\n#include <map>\n#include <imgui.h>\n#include \"timing.h"
  },
  {
    "path": "src/imgui_utils.h",
    "chars": 1159,
    "preview": "#pragma once\n\n#include <imgui.h>\n\n#ifdef __linux__\n#include <implot.h>\n#endif\n\nstruct imgui_contexts {\n    ImGuiContext*"
  },
  {
    "path": "src/iostats.cpp",
    "chars": 1360,
    "preview": "#include \"iostats.h\"\n#include \"string_utils.h\"\n#include <fstream>\n#include \"hud_elements.h\"\n\nstruct iostats g_io_stats;\n"
  },
  {
    "path": "src/iostats.h",
    "chars": 585,
    "preview": "#pragma once\n#ifndef MANGOHUD_IOSTATS_H\n#define MANGOHUD_IOSTATS_H\n\n#include <inttypes.h>\n#include \"timing.hpp\"\n\nstruct "
  },
  {
    "path": "src/keybinds.cpp",
    "chars": 3044,
    "preview": "#include <cstdint>\n#include <cstring>\n#include <array>\n#include <algorithm>\n#include <unistd.h>\n#include \"hud_elements.h"
  },
  {
    "path": "src/keybinds.h",
    "chars": 1532,
    "preview": "#pragma once\n#ifndef MANGOHUD_KEYBINDS_H\n#define MANGOHUD_KEYBINDS_H\n\n#ifdef HAVE_X11\n#include \"shared_x11.h\"\n#include \""
  },
  {
    "path": "src/loaders/loader_dbus.cpp",
    "chars": 8889,
    "preview": "\n#include \"loaders/loader_dbus.h\"\n#include <iostream>\n#include <spdlog/spdlog.h>\n\n// Put these sanity checks here so tha"
  },
  {
    "path": "src/loaders/loader_dbus.h",
    "chars": 2400,
    "preview": "\n#ifndef LIBRARY_LOADER_DBUS_H\n#define LIBRARY_LOADER_DBUS_H\n\n#include <dbus/dbus.h>\n#define LIBRARY_LOADER_DBUS_H_DLOPE"
  },
  {
    "path": "src/loaders/loader_glx.cpp",
    "chars": 4566,
    "preview": "#include <iostream>\n#include <spdlog/spdlog.h>\n#include \"real_dlsym.h\"\n#include \"loaders/loader_glx.h\"\n\nglx_loader::glx_"
  },
  {
    "path": "src/loaders/loader_glx.h",
    "chars": 1322,
    "preview": "#pragma once\n#include \"gl/gl.h\"\n#include <dlfcn.h>\n\nclass glx_loader {\n public:\n  glx_loader();\n  ~glx_loader();\n\n  bool"
  },
  {
    "path": "src/loaders/loader_nvctrl.cpp",
    "chars": 3067,
    "preview": "#include \"loader_nvctrl.h\"\n#include <iostream>\n#include <spdlog/spdlog.h>\n\n// Put these sanity checks here so that they "
  },
  {
    "path": "src/loaders/loader_nvctrl.h",
    "chars": 1275,
    "preview": "#pragma once\n#ifndef LIBRARY_LOADER_NVCTRL_H\n#define LIBRARY_LOADER_NVCTRL_H\n// #define Bool bool\n#include <X11/Xlib.h>\n"
  },
  {
    "path": "src/loaders/loader_nvml.cpp",
    "chars": 9052,
    "preview": "// This is generated file. Do not modify directly.\n// Path to the code generator: /home/crz/git/MangoHud/generate_librar"
  },
  {
    "path": "src/loaders/loader_nvml.h",
    "chars": 2240,
    "preview": "// This is generated file. Do not modify directly.\n// Path to the code generator: /home/crz/git/MangoHud/generate_librar"
  },
  {
    "path": "src/loaders/loader_x11.cpp",
    "chars": 2511,
    "preview": "#include \"loader_x11.h\"\n#include <iostream>\n#include <spdlog/spdlog.h>\n\nlibx11_loader::libx11_loader() : loaded_(false) "
  },
  {
    "path": "src/loaders/loader_x11.h",
    "chars": 962,
    "preview": "#pragma once\n#include <X11/Xlib.h>\n#include <memory>\n\n#include <string>\n#include <dlfcn.h>\n\nclass libx11_loader {\n publi"
  },
  {
    "path": "src/logging.cpp",
    "chars": 12190,
    "preview": "#include <sstream>\n#include <iomanip>\n#include <array>\n#include <algorithm>\n#include <spdlog/spdlog.h>\n#include \"logging"
  },
  {
    "path": "src/logging.h",
    "chars": 1911,
    "preview": "#pragma once\n#ifndef MANGOHUD_LOGGING_H\n#define MANGOHUD_LOGGING_H\n\n#include <iostream>\n#include <vector>\n#include <fstr"
  },
  {
    "path": "src/mangohud.json.in",
    "chars": 607,
    "preview": "{\n    \"file_format_version\" : \"1.0.0\",\n    \"layer\" : {\n      \"name\": \"VK_LAYER_MANGOHUD_overlay_@cpu_family@\",\n      \"ty"
  },
  {
    "path": "src/mangohud.version",
    "chars": 186,
    "preview": "# in base\n{\n  global:\n    overlay_GetInstanceProcAddr;\n    overlay_GetDeviceProcAddr;\n    glX*;\n    egl*;\n    dlsym;\n   "
  },
  {
    "path": "src/memory.cpp",
    "chars": 2558,
    "preview": "#include <array>\n#include <fstream>\n#include <map>\n#include <spdlog/spdlog.h>\n#include <string>\n#include <unistd.h>\n#inc"
  },
  {
    "path": "src/memory.h",
    "chars": 313,
    "preview": "#pragma once\n#ifndef MANGOHUD_MEMORY_H\n#define MANGOHUD_MEMORY_H\n\n#include <cstdint>\n\nextern float memused, memmax, swap"
  },
  {
    "path": "src/mesa/c11_compat.h",
    "chars": 483,
    "preview": "/* Copyright 2019 Intel Corporation */\n/* SPDX-License-Identifier: MIT */\n\n#include \"no_extern_c.h\"\n\n#ifndef _C11_COMPAT"
  },
  {
    "path": "src/mesa/c99_compat.h",
    "chars": 5298,
    "preview": "/**************************************************************************\n *\n * Copyright 2007-2013 VMware, Inc.\n * Al"
  },
  {
    "path": "src/mesa/no_extern_c.h",
    "chars": 2050,
    "preview": "/**************************************************************************\n *\n * Copyright 2014 VMware, Inc.\n * All Rig"
  },
  {
    "path": "src/mesa/util/detect_os.h",
    "chars": 2517,
    "preview": "/* SPDX-License-Identifier: MIT */\n/* Copyright 2008 VMware, Inc. */\n\n/**\n * Auto-detect the operating system family.\n *"
  },
  {
    "path": "src/mesa/util/macros.h",
    "chars": 2359,
    "preview": "// /*\n//  * Copyright © 2014 Intel Corporation\n//  *\n//  * Permission is hereby granted, free of charge, to any person o"
  },
  {
    "path": "src/mesa/util/os_socket.c",
    "chars": 1940,
    "preview": "/*\n * Copyright 2019 Intel Corporation\n * SPDX-License-Identifier: MIT\n */\n\n#include <errno.h>\n\n#include \"os_socket.h\"\n\n"
  },
  {
    "path": "src/mesa/util/os_socket.h",
    "chars": 680,
    "preview": "/*\n * Copyright 2019 Intel Corporation\n * SPDX-License-Identifier: MIT\n *\n * Socket operations helpers\n */\n\n#ifndef _OS_"
  },
  {
    "path": "src/mesa/util/os_time.c",
    "chars": 5142,
    "preview": "/**************************************************************************\n *\n * Copyright 2008-2010 VMware, Inc.\n * Al"
  },
  {
    "path": "src/mesa/util/os_time.h",
    "chars": 3514,
    "preview": "/**************************************************************************\n *\n * Copyright 2008-2010 VMware, Inc.\n * Al"
  },
  {
    "path": "src/meson.build",
    "chars": 7813,
    "preview": "glslang = find_program('glslang', 'glslangValidator')\n\nif get_option('dynamic_string_tokens')\n  ld_prefix = get_option('"
  },
  {
    "path": "src/net.cpp",
    "chars": 2950,
    "preview": "#include \"net.h\"\n#include \"hud_elements.h\"\n\nNet::Net() {\n    auto params = get_params();\n    should_reset = false;\n    f"
  },
  {
    "path": "src/net.h",
    "chars": 1080,
    "preview": "#pragma once\n#include <vector>\n#include <string>\n#include <stdint.h>\n#include \"filesystem.h\"\n#include \"file_utils.h\"\n#in"
  },
  {
    "path": "src/notify.cpp",
    "chars": 2480,
    "preview": "#include <chrono>\n#include <unistd.h>\n#include <fcntl.h>\n#include <sys/types.h>\n#include <sys/inotify.h>\n#include <spdlo"
  },
  {
    "path": "src/notify.h",
    "chars": 397,
    "preview": "#pragma once\n#ifndef MANGOHUD_NOTIFY_H\n#define MANGOHUD_NOTIFY_H\n\n#include <thread>\n#include <mutex>\n#include \"overlay_p"
  },
  {
    "path": "src/nvapi.cpp",
    "chars": 2204,
    "preview": "#include <windows.h>\n#include <iostream>\n#include \"gpu.h\"\n\n// magic numbers, do not change them\n#define NVAPI_MAX_PHYSIC"
  },
  {
    "path": "src/nvidia.cpp",
    "chars": 11329,
    "preview": "#ifdef HAVE_NVML\n#include \"nvml.h\"\n#endif\n#include \"hud_elements.h\"\n#include \"logging.h\"\n#include \"string_utils.h\"\n#incl"
  },
  {
    "path": "src/nvidia.h",
    "chars": 3254,
    "preview": "#pragma once\n#include \"gpu.h\"\n#ifdef HAVE_NVML\n#include \"loaders/loader_nvml.h\"\n#endif\n#ifdef HAVE_XNVCTRL\n#include \"loa"
  },
  {
    "path": "src/overlay.cpp",
    "chars": 35428,
    "preview": "#include <sstream>\n#include <iomanip>\n#include <algorithm>\n#include <thread>\n#include <condition_variable>\n#include <spd"
  },
  {
    "path": "src/overlay.frag",
    "chars": 265,
    "preview": "#version 450 core\nlayout(location = 0) out vec4 fColor;\n\nlayout(set=0, binding=0) uniform sampler2D sTexture;\n\nlayout(lo"
  },
  {
    "path": "src/overlay.h",
    "chars": 5239,
    "preview": "#pragma once\n#ifndef MANGOHUD_OVERLAY_H\n#define MANGOHUD_OVERLAY_H\n\n#include <string>\n#include <stdint.h>\n#include <vect"
  },
  {
    "path": "src/overlay.vert",
    "chars": 447,
    "preview": "#version 450 core\nlayout(location = 0) in vec2 aPos;\nlayout(location = 1) in vec2 aUV;\nlayout(location = 2) in vec4 aCol"
  },
  {
    "path": "src/overlay_params.cpp",
    "chars": 45541,
    "preview": "#include <cstdint>\n#ifdef _WIN32\n#include <windows.h>\n#endif\n#include <stdio.h>\n#include <string.h>\n#include <stdlib.h>\n"
  },
  {
    "path": "src/overlay_params.h",
    "chars": 16642,
    "preview": "#pragma once\n#ifndef MANGOHUD_OVERLAY_PARAMS_H\n#define MANGOHUD_OVERLAY_PARAMS_H\n\n#include <string>\n#include <vector>\n#i"
  },
  {
    "path": "src/pci_ids.cpp",
    "chars": 2045,
    "preview": "#include <spdlog/spdlog.h>\n#include <string>\n#include <iostream>\n#include <fstream>\n#include <sstream>\n#include <iomanip"
  },
  {
    "path": "src/pci_ids.h",
    "chars": 466,
    "preview": "#pragma once\n#ifndef MANGOHUD_PCI_IDS_H\n#define MANGOHUD_PCI_IDS_H\n\n#include <map>\n#include <vector>\n\nstruct subsys_devi"
  },
  {
    "path": "src/real_dlsym.c",
    "chars": 2807,
    "preview": "/**\n * \\author Pyry Haulos <pyry.haulos@gmail.com>\n * \\date 2007-2008\n * For conditions of distribution and use, see cop"
  },
  {
    "path": "src/real_dlsym.h",
    "chars": 416,
    "preview": "#pragma once\n#ifndef MANGOHUD_REAL_DLSYM_H\n#define MANGOHUD_REAL_DLSYM_H\n\n#define EXPORT_C_(type) extern \"C\" __attribute"
  },
  {
    "path": "src/shared_x11.cpp",
    "chars": 1511,
    "preview": "#include <cstdlib>\n#include <iostream>\n#include <memory>\n#include <functional>\n#include <spdlog/spdlog.h>\n#include \"shar"
  },
  {
    "path": "src/shared_x11.h",
    "chars": 171,
    "preview": "#pragma once\n#ifndef MANGOHUD_SHARED_X11_H\n#define MANGOHUD_SHARED_X11_H\n\n#include <X11/Xlib.h>\n\nDisplay* get_xdisplay()"
  },
  {
    "path": "src/shell.cpp",
    "chars": 2523,
    "preview": "#include \"shell.h\"\n#include <thread>\n#include <iostream>\n#include <sys/wait.h>\n#include <spdlog/spdlog.h>\n#include \"stri"
  },
  {
    "path": "src/shell.h",
    "chars": 685,
    "preview": "#pragma once\n#include <fcntl.h>\n#include <unistd.h>\n#include <cstring>\n#ifdef __linux__\n#include <sys/wait.h>\n#endif\n#in"
  },
  {
    "path": "src/string_utils.h",
    "chars": 4362,
    "preview": "#pragma once\n#ifndef MANGOHUD_STRING_UTILS_H\n#define MANGOHUD_STRING_UTILS_H\n\n#include <string>\n#include <vector>\n#inclu"
  },
  {
    "path": "src/timing.hpp",
    "chars": 519,
    "preview": "#pragma once\n#ifndef MANGOHUD_TIMING_HPP\n#define MANGOHUD_TIMING_HPP\n\n#include <chrono>\n\n#include \"mesa/util/os_time.h\"\n"
  },
  {
    "path": "src/vulkan.cpp",
    "chars": 91307,
    "preview": "/*\n * Copyright © 2019 Intel Corporation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n "
  },
  {
    "path": "src/wayland_hook.h",
    "chars": 423,
    "preview": "#include <wayland-client.h>\n#include <set>\n#include <vector>\n\n#ifndef KeySym\ntypedef unsigned long KeySym;\n#endif\n\nexter"
  },
  {
    "path": "src/wayland_keybinds.cpp",
    "chars": 8604,
    "preview": "#include <cstdint>\n#include <cstring>\n#include <set>\n#include <unistd.h>\n#include <map>\n#include <wayland-client.h>\n#inc"
  },
  {
    "path": "src/win/d3d11_hook.cpp",
    "chars": 878,
    "preview": "#include \"kiero.h\"\n\n#if KIERO_INCLUDE_D3D11\n\n#include \"d3d11_hook.h\"\n#include <assert.h>\n#include <intrin.h>\n\n#include \""
  },
  {
    "path": "src/win/d3d11_hook.h",
    "chars": 253,
    "preview": "#pragma once\n#ifndef __D3D11_IMPL_H__\n#define __D3D11_IMPL_H__\n#include <d3d11.h>\nnamespace impl\n{\n\tnamespace d3d11\n\t{\n\t"
  },
  {
    "path": "src/win/d3d12_hook.cpp",
    "chars": 681,
    "preview": "#include <cstdio>\n#include <cassert>\n#include \"kiero.h\"\n#include \"d3d12_hook.h\"\n#include \"d3d_shared.h\"\n#include \"../ove"
  },
  {
    "path": "src/win/d3d12_hook.h",
    "chars": 402,
    "preview": "#pragma once\n#include <dxgi.h>\n#include <dxgi1_5.h>\n#include <dxgi1_4.h>\n#ifdef _MSC_VER\n    #include <d3d12.h>\n#else\n  "
  },
  {
    "path": "src/win/d3d_shared.cpp",
    "chars": 588,
    "preview": "#include \"d3d_shared.h\"\n#include \"overlay.h\"\n\nbool cfg_inited = false;\nImVec2 window_size;\noverlay_params params {};\nstr"
  },
  {
    "path": "src/win/d3d_shared.h",
    "chars": 345,
    "preview": "#include \"../overlay.h\"\n#include \"kiero.h\"\n\nextern bool cfg_inited;\nextern ImVec2 window_size;\nextern struct overlay_par"
  },
  {
    "path": "src/win/dxgi.cpp",
    "chars": 1312,
    "preview": "#include \"kiero.h\"\n#include \"windows.h\"\n#include <dxgi.h>\n#include <cstdio>\n#include \"dxgi.h\"\n\n#ifdef _UNICODE\n# define "
  },
  {
    "path": "src/win/dxgi.h",
    "chars": 43,
    "preview": "#pragma once\nuint32_t get_device_id_dxgi();"
  },
  {
    "path": "src/win/kiero.cpp",
    "chars": 27767,
    "preview": "#include \"kiero.h\"\n#include <windows.h>\n#include <assert.h>\n#include <cstdio>\n\n#if KIERO_INCLUDE_D3D9\n# include <d3d9.h>"
  },
  {
    "path": "src/win/kiero.h",
    "chars": 1405,
    "preview": "#ifndef __KIERO_H__\n#define __KIERO_H__\n\n#include <stdint.h>\n\n#define KIERO_VERSION \"1.2.10\"\n\n#define KIERO_INCLUDE_D3D9"
  },
  {
    "path": "src/win/main.cpp",
    "chars": 1932,
    "preview": "#include <cstdio>\n#include \"kiero.h\"\n#include <vector>\n#include \"win_shared.h\"\n#if KIERO_INCLUDE_D3D11\n# include \"d3d11_"
  },
  {
    "path": "src/win/win_shared.h",
    "chars": 159,
    "preview": "#pragma once\n#include \"windows.h\"\nvoid ConsoleSetup();\nvoid renderTypes();\nint MainThread();\nBOOL WINAPI DllMain(HINSTAN"
  },
  {
    "path": "src/winesync.h",
    "chars": 1683,
    "preview": "#include \"file_utils.h\"\n#include <filesystem.h>\n#include <string>\n#include <spdlog/spdlog.h>\n#include \"hud_elements.h\"\n#"
  },
  {
    "path": "steamrt.Dockerfile.in",
    "chars": 925,
    "preview": "FROM scratch\nADD com.valvesoftware.SteamRuntime.Sdk-amd64,i386-%RUNTIME%-sysroot.tar.gz /\nWORKDIR /build\nRUN \\\nset -e; \\"
  },
  {
    "path": "subprojects/cmocka.wrap",
    "chars": 131,
    "preview": "[wrap-git]\nurl = https://gitlab.com/cmocka/cmocka.git\nrevision = 59dc0013f9f29fcf212fe4911c78e734263ce24c\ndepth = 1\nbran"
  },
  {
    "path": "subprojects/imgui.wrap",
    "chars": 590,
    "preview": "[wrap-file]\ndirectory = imgui-1.91.6\nsource_url = https://github.com/ocornut/imgui/archive/refs/tags/v1.91.6.tar.gz\nsour"
  },
  {
    "path": "subprojects/implot.wrap",
    "chars": 574,
    "preview": "[wrap-file]\ndirectory = implot-0.16\nsource_url = https://github.com/epezent/implot/archive/refs/tags/v0.16.zip\nsource_fi"
  },
  {
    "path": "subprojects/minhook.wrap",
    "chars": 141,
    "preview": "[wrap-git]\nurl = https://github.com/flightlessmango/minhook.git\nrevision = 81d6f8c775b0be984a91ea927b7beadb4f2d9d86\ndept"
  },
  {
    "path": "subprojects/packagefiles/vulkan-headers/meson.build",
    "chars": 320,
    "preview": "project(\n  'vulkan-headers',\n  'c',\n  license: 'Apache-2.0',\n  version: '1.4.345',\n  meson_version: '>=0.56.0',\n)\n\nvulka"
  },
  {
    "path": "subprojects/packagefiles/vulkan-utility-libraries/meson.build",
    "chars": 316,
    "preview": "project(\n  'vulkan-utility-libraries',\n  'c',\n  license: 'Apache-2.0',\n  version: '1.4.346',\n  meson_version: '>=0.56.0'"
  },
  {
    "path": "subprojects/spdlog.wrap",
    "chars": 598,
    "preview": "[wrap-file]\ndirectory = spdlog-1.14.1\nsource_url = https://github.com/gabime/spdlog/archive/refs/tags/v1.14.1.tar.gz\nsou"
  },
  {
    "path": "subprojects/vulkan-headers.wrap",
    "chars": 335,
    "preview": "[wrap-file]\ndirectory = Vulkan-Headers-1.4.346\nsource_url = https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.4."
  },
  {
    "path": "subprojects/vulkan-utility-libraries.wrap",
    "chars": 384,
    "preview": "[wrap-file]\ndirectory = Vulkan-Utility-Libraries-1.4.346\nsource_url = https://github.com/KhronosGroup/Vulkan-Utility-Lib"
  },
  {
    "path": "tests/params.py",
    "chars": 5595,
    "preview": "import re\nimport subprocess\n\nclass Test:\n    def __init__(self):\n        self.options = {}\n        self.error_count = 0\n"
  },
  {
    "path": "tests/test_amdgpu.cpp",
    "chars": 3571,
    "preview": "#include <stdarg.h>\n#include <stddef.h>\n#include <setjmp.h>\n#include <stdint.h>\nextern \"C\" {\n#include <cmocka.h>\n}\n#incl"
  },
  {
    "path": "version.h.in",
    "chars": 51,
    "preview": "#pragma once\n\n#define MANGOHUD_VERSION \"@VCS_TAG@\"\n"
  }
]

// ... and 3 more files (download for full content)

About this extraction

This page contains the full source code of the flightlessmango/MangoHud GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 187 files (2.2 MB), approximately 596.7k tokens, and a symbol index with 1003 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!