# zeux/volk architecture

> Architecture diagram of the GitHub repository zeux/volk, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zeux/volk
- Repository: https://github.com/zeux/volk

## Overview

volk is a C89 Vulkan meta-loader. An application includes volk.h, initializes the system Vulkan loader, creates a Vulkan instance, then loads instance entrypoints; after device creation it can load device functions globally or into a per-device table to reduce dispatch overhead. The graph separates loader bootstrap, instance loading, and device loading. The README documents this sequence and the optimization modes; the sampled volk.c excerpts show generated entrypoint loading, but not the initializer implementation.

Main entry points: [`volk.c`](https://github.com/zeux/volk/blob/master/volk.c) (Initialize loader), [`volk.h`](https://github.com/zeux/volk/blob/master/volk.h) (API and declarations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Public API"]
  node_header["API and declarations<br/>[volk.h]"]
end

subgraph group_loader["Loader Bootstrap"]
  node_initialize["Initialize loader<br/>[volk.c]"]
  node_system_loader["System Vulkan loader"]
end

subgraph group_instance["Instance Loading"]
  node_instance_load["Load instance functions<br/>[volk.c]"]
  node_instance["Vulkan instance"]
end

subgraph group_device["Device Loading"]
  node_device_load["Load device functions<br/>[volk.c]"]
  node_device_table["Device function table<br/>[volk.h]"]
end

node_application(("Vulkan Application"))
node_driver["Vulkan driver"]

node_application -->|"includes API"| node_header
node_application -->|"calls initialize"| node_initialize
node_initialize -->|"loads from system"| node_system_loader
node_application -->|"creates instance"| node_instance
node_application -->|"loads entrypoints"| node_instance_load
node_instance_load -->|"uses instance"| node_instance
node_application -->|"loads device functions"| node_device_load
node_device_load -->|"resolves functions"| node_driver
node_application -->|"uses per-device table"| node_device_table

click node_header "https://github.com/zeux/volk/blob/master/volk.h"
click node_initialize "https://github.com/zeux/volk/blob/master/volk.c"
click node_instance_load "https://github.com/zeux/volk/blob/master/volk.c"
click node_device_load "https://github.com/zeux/volk/blob/master/volk.c"
click node_device_table "https://github.com/zeux/volk/blob/master/volk.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_header toneBlue
class node_initialize,node_system_loader toneAmber
class node_instance_load,node_instance toneMint
class node_device_load,node_device_table toneRose
class node_application,node_driver toneIndigo
```

## Components

### Public API

- [API and declarations](https://github.com/zeux/volk/blob/master/volk.h): `volk.h`

### Loader Bootstrap

- [Initialize loader](https://github.com/zeux/volk/blob/master/volk.c): `volk.c`
- **System Vulkan loader**

### Instance Loading

- [Load instance functions](https://github.com/zeux/volk/blob/master/volk.c): `volk.c`
- **Vulkan instance**

### Device Loading

- [Load device functions](https://github.com/zeux/volk/blob/master/volk.c): `volk.c`
- [Device function table](https://github.com/zeux/volk/blob/master/volk.h): `volk.h`

### Other components

- **Vulkan Application**
- **Vulkan driver**

## Connections

- Vulkan Application → API and declarations: includes API (evidence: `README.md`)
- Vulkan Application → Initialize loader: calls initialize (evidence: `README.md`)
- Initialize loader → System Vulkan loader: loads from system (evidence: `README.md`)
- Vulkan Application → Vulkan instance: creates instance (evidence: `README.md`)
- Vulkan Application → Load instance functions: loads entrypoints (evidence: `README.md`)
- Load instance functions → Vulkan instance: uses instance (evidence: `README.md`)
- Vulkan Application → Load device functions: loads device functions (evidence: `README.md`)
- Load device functions → Vulkan driver: resolves functions (evidence: `README.md`)
- Vulkan Application → Device function table: uses per-device table (evidence: `README.md`)
