# khronosgroup/vulkan-tutorial architecture

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

- Interactive diagram: https://gitdiagram.com/khronosgroup/vulkan-tutorial
- Repository: https://github.com/khronosgroup/vulkan-tutorial

## Overview

1. This repository is primarily a documentation and sample-code workspace for the Khronos Vulkan Tutorial, not a single runtime application. The main product is a static documentation site generated from AsciiDoc sources, with companion code examples and assets used throughout the tutorial.

2. The documentation source lives under `en/`, organized by tutorial chapters. It includes the foundational Vulkan tutorial, a larger “Building a Simple Engine” track, and a ray tracing course. The chapter structure is the main information architecture for the repo and is what Antora turns into the published site.

3. `antora/` plus `antora-ci-playbook.yml` define the static-site build pipeline. Antora reads the chapter navigation and page sources, assembles them into the Vulkan Docs site, and publishes the tutorial content. The GitHub Actions workflows in `.github/workflows/` automate validation and site/doc builds.

4. `attachments/` is the code-and-asset boundary for the tutorial. It contains the runnable example programs, shader sources, PDFs, and media referenced from the docs. These files are the concrete implementation artifacts that correspond to the written explanations in `en/`.

5. The numbered files in `attachments/` model the tutorial progression step-by-step. They show the evolution from basic Vulkan initialization through swap chains, pipelines, buffers, textures, compute, and ray tracing. This directory is the clearest place to draw a “teaching flow” diagram, because each example depends on prior steps and introduces one new concept at a time.

6. `attachments/assets/` and the model-related files under `attachments/` are the tutorial’s content pipeline for graphics resources. They provide meshes, textures, and other inputs used by the rendering examples, and they illustrate the boundary between source code and runtime data loaded by the examples.

7. `attachments/simple_engine/` is a separate, more integrated C++ engine sample that builds on the earlier tutorial. Its architecture is component- and system-oriented: entities, components, resource management, rendering, physics, audio, ImGui UI, model loading, and scene loading are split into distinct translation units and headers.

8. The `simple_engine` rendering stack is subdivided further into renderer core, rendering passes, pipeline setup, resource handling, compute, and ray-query support. The repo’s engine-oriented chapters in `en/Building_a_Simple_Engine/` map directly to these subsystems, so a diagram should show a central engine shell feeding a specialized rendering pipeline with optional advanced features.

9. The engine code is built around Vulkan plus modern companion libraries: Vulkan-Hpp with RAII, Slang shader sources, and helper integrations for GLM, tinygltf, tinyobjloader, stb, KTX, and nlohmann/json. These are not just dependencies; they shape the architecture by separating GPU resource creation, shader compilation, and asset loading into dedicated layers.

10. There are platform-specific entry points for desktop and Android. The Android apps under `attachments/android/` and `attachments/simple_engine/android/` form a bridge from Java activity code to native C++ via `game_activity_bridge.cpp`, while the native side is built with CMake. This creates a clear platform boundary: UI/activity on Android, engine core in native code.

11. Supporting subsystems in `simple_engine` include threading, memory pooling, descriptor management, Vulkan device abstraction, swap-chain handling, and dispatch initialization. These are infrastructural layers beneath rendering and gameplay logic, and they exist to hide low-level Vulkan complexity from higher-level engine code.

12. Tooling is part of the architecture. The repo includes dependency-install scripts for Linux and Windows, CMake find modules for third-party libraries, and shell/batch helpers for fetching assets. These scripts are important because the code examples and engine samples depend on native toolchains and external SDKs, especially Vulkan and a C++ build environment.

13. CI is documentation-centric but still architecture-relevant: GitHub Actions validates content and buildability. That means the repository has two major quality gates—docs/site generation and code/example correctness—rather than a single application test pipeline.

14. In diagram form, the cleanest high-level separation is: tutorial source content in `en/` → site generation via Antora; tutorial code/examples/assets in `attachments/` → compiled samples and engine demos; and `simple_engine/` as the most complete runtime subsystem graph, with rendering, resource, scene, and platform layers connected to Vulkan and shader assets.

Main entry points: [`attachments/simple_engine/engine.cpp`](https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/simple_engine/engine.cpp) (Engine core), [`antora/modules/ROOT/nav.adoc`](https://github.com/khronosgroup/vulkan-tutorial/blob/main/antora/modules/ROOT/nav.adoc) (Nav), [`en/03_Drawing_a_triangle/00_Setup/00_Base_code.adoc`](https://github.com/khronosgroup/vulkan-tutorial/blob/main/en/03_Drawing_a_triangle/00_Setup/00_Base_code.adoc) (Tutorial docs), [`attachments/00_base_code.cpp`](https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/00_base_code.cpp) (Tutorial steps)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_docs["Docs site"]
  node_antora_playbook["Antora<br/>site build"]
  node_nav["Nav<br/>[nav.adoc]"]
  node_intro_docs["Tutorial docs<br/>asciidoc chapters<br/>[00_Base_code.adoc]"]
  node_engine_docs["Engine track<br/>asciidoc course<br/>[introduction.adoc]"]
  node_ray_docs["Ray tracing course<br/>asciidoc course<br/>[00_Overview.adoc]"]
end

subgraph group_tutorial["Tutorial examples"]
  node_example_chain["Tutorial steps<br/>sample progression<br/>[00_base_code.cpp]"]
  node_shader_pack["Shaders<br/>shader sources"]
  node_assets[("Assets<br/>media resources<br/>[viking_room.glb]")]
end

subgraph group_engine["Simple engine"]
  node_engine_shell["Engine core<br/>engine runtime<br/>[engine.cpp]"]
  node_ecs["ECS model<br/>entity-component<br/>[entity.cpp]"]
  node_resources["Resources<br/>asset mgmt"]
  node_render_core["Render core<br/>vulkan renderer<br/>[renderer_core.cpp]"]
  node_render_stages["Render stages<br/>render passes"]
  node_vulkan_backend["Vulkan backend<br/>device/swapchain<br/>[vulkan_device.cpp]"]
  node_scene_load["Scene loading<br/>content pipeline<br/>[scene_loading.cpp]"]
  node_ui_audio_physics["Subsystems<br/>runtime systems<br/>[imgui_system.cpp]"]
end

subgraph group_platform["Platform bridges"]
  node_android_bridge["Android bridge<br/>native bridge"]
  node_android_activity["Android app<br/>java entrypoint"]
end

subgraph group_automation["Automation"]
  node_ci["CI workflows<br/>github actions<br/>[workflow.yml]"]
  node_tooling["Tooling<br/>build scripts"]
end

node_antora_playbook -->|"assembles"| node_nav
node_nav -->|"indexes"| node_intro_docs
node_nav -->|"indexes"| node_engine_docs
node_nav -->|"indexes"| node_ray_docs
node_intro_docs -->|"explains"| node_example_chain
node_intro_docs -->|"references"| node_shader_pack
node_intro_docs -->|"references"| node_assets
node_example_chain -->|"uses"| node_shader_pack
node_example_chain -->|"loads"| node_assets
node_engine_docs -->|"maps to"| node_engine_shell
node_engine_shell -->|"coordinates"| node_ecs
node_engine_shell -->|"owns"| node_resources
node_engine_shell -->|"drives"| node_render_core
node_render_core -->|"routes"| node_render_stages
node_render_core -->|"depends on"| node_vulkan_backend
node_render_stages -->|"binds"| node_resources
node_scene_load -->|"populates"| node_ecs
node_scene_load -->|"imports"| node_assets
node_ui_audio_physics -->|"extends"| node_engine_shell
node_android_activity -->|"calls"| node_android_bridge
node_android_bridge -->|"starts"| node_engine_shell
node_ci -->|"validates"| node_antora_playbook
node_ci -->|"uses"| node_tooling
node_tooling -->|"supports"| node_vulkan_backend

click node_antora_playbook "https://github.com/khronosgroup/vulkan-tutorial/blob/main/antora-ci-playbook.yml"
click node_nav "https://github.com/khronosgroup/vulkan-tutorial/blob/main/antora/modules/ROOT/nav.adoc"
click node_intro_docs "https://github.com/khronosgroup/vulkan-tutorial/blob/main/en/03_Drawing_a_triangle/00_Setup/00_Base_code.adoc"
click node_engine_docs "https://github.com/khronosgroup/vulkan-tutorial/blob/main/en/Building_a_Simple_Engine/introduction.adoc"
click node_ray_docs "https://github.com/khronosgroup/vulkan-tutorial/blob/main/en/courses/18_Ray_tracing/00_Overview.adoc"
click node_example_chain "https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/00_base_code.cpp"
click node_shader_pack "https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/09_shader_base.slang"
click node_assets "https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/assets/viking_room.glb"
click node_engine_shell "https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/simple_engine/engine.cpp"
click node_ecs "https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/simple_engine/entity.cpp"
click node_resources "https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/simple_engine/resource_manager.cpp"
click node_render_core "https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/simple_engine/renderer_core.cpp"
click node_render_stages "https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/simple_engine/renderer_rendering.cpp"
click node_vulkan_backend "https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/simple_engine/vulkan_device.cpp"
click node_scene_load "https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/simple_engine/scene_loading.cpp"
click node_ui_audio_physics "https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/simple_engine/imgui_system.cpp"
click node_android_bridge "https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/simple_engine/android/app/src/main/cpp/game_activity_bridge.cpp"
click node_android_activity "https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/simple_engine/android/app/src/main/java/com/simple_engine/VulkanActivity.java"
click node_ci "https://github.com/khronosgroup/vulkan-tutorial/blob/main/.github/workflows/workflow.yml"
click node_tooling "https://github.com/khronosgroup/vulkan-tutorial/blob/main/scripts/install_dependencies_linux.sh"

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_antora_playbook,node_nav,node_intro_docs,node_engine_docs,node_ray_docs toneBlue
class node_example_chain,node_shader_pack,node_assets toneAmber
class node_engine_shell,node_ecs,node_resources,node_render_core,node_render_stages,node_vulkan_backend,node_scene_load,node_ui_audio_physics toneMint
class node_android_bridge,node_android_activity toneRose
class node_ci,node_tooling toneIndigo
```

## Components

### Docs site

AsciiDoc sources and Antora site assembly

- [Antora](https://github.com/khronosgroup/vulkan-tutorial/blob/main/antora-ci-playbook.yml): site build · Static-site generation pipeline for the documentation · `antora-ci-playbook.yml`
- [Nav](https://github.com/khronosgroup/vulkan-tutorial/blob/main/antora/modules/ROOT/nav.adoc): site nav · Antora navigation that defines the published content structure · `antora/modules/ROOT/nav.adoc`
- [Tutorial docs](https://github.com/khronosgroup/vulkan-tutorial/blob/main/en/03_Drawing_a_triangle/00_Setup/00_Base_code.adoc): asciidoc chapters · Main Vulkan tutorial chapters under en/ · `en/03_Drawing_a_triangle/00_Setup/00_Base_code.adoc`
- [Engine track](https://github.com/khronosgroup/vulkan-tutorial/blob/main/en/Building_a_Simple_Engine/introduction.adoc): asciidoc course · Building a Simple Engine chapter set · `en/Building_a_Simple_Engine/introduction.adoc`
- [Ray tracing course](https://github.com/khronosgroup/vulkan-tutorial/blob/main/en/courses/18_Ray_tracing/00_Overview.adoc): asciidoc course · Ray tracing course chapters and overview · `en/courses/18_Ray_tracing/00_Overview.adoc`

### Tutorial examples

Step-by-step Vulkan sample programs and assets

- [Tutorial steps](https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/00_base_code.cpp): sample progression · Numbered examples that evolve the core Vulkan tutorial · `attachments/00_base_code.cpp`
- [Shaders](https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/09_shader_base.slang): shader sources · Representative shader set used across tutorial stages · `attachments/09_shader_base.slang`
- [Assets](https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/assets/viking_room.glb): media resources · Meshes, textures, and other tutorial runtime assets · `attachments/assets/viking_room.glb`

### Simple engine

Component-based engine sample and Vulkan rendering stack

- [Engine core](https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/simple_engine/engine.cpp): engine runtime · Main engine entry point and lifecycle orchestration · `attachments/simple_engine/engine.cpp`
- [ECS model](https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/simple_engine/entity.cpp): entity-component · Entity, component, and transform/camera/mesh systems · `attachments/simple_engine/entity.cpp`
- [Resources](https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/simple_engine/resource_manager.cpp): asset mgmt · Resource and descriptor management for GPU assets · `attachments/simple_engine/resource_manager.cpp`
- [Render core](https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/simple_engine/renderer_core.cpp): vulkan renderer · Renderer orchestration and core rendering flow · `attachments/simple_engine/renderer_core.cpp`
- [Render stages](https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/simple_engine/renderer_rendering.cpp): render passes · Pipelines for rendering, compute, and ray-query paths · `attachments/simple_engine/renderer_rendering.cpp`
- [Vulkan backend](https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/simple_engine/vulkan_device.cpp): device/swapchain · Device, dispatch, swap-chain, and pipeline setup layers · `attachments/simple_engine/vulkan_device.cpp`
- [Scene loading](https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/simple_engine/scene_loading.cpp): content pipeline · Scene and model loading into the engine runtime · `attachments/simple_engine/scene_loading.cpp`
- [Subsystems](https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/simple_engine/imgui_system.cpp): runtime systems · ImGui UI, audio, and physics subsystems · `attachments/simple_engine/imgui_system.cpp`

### Platform bridges

Android entry points and native bridge code

- [Android bridge](https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/simple_engine/android/app/src/main/cpp/game_activity_bridge.cpp): native bridge · Java activity to native C++ bridge for Android builds · `attachments/simple_engine/android/app/src/main/cpp/game_activity_bridge.cpp`
- [Android app](https://github.com/khronosgroup/vulkan-tutorial/blob/main/attachments/simple_engine/android/app/src/main/java/com/simple_engine/VulkanActivity.java): java entrypoint · Android activity and app entry layer · `attachments/simple_engine/android/app/src/main/java/com/simple_engine/VulkanActivity.java`

### Automation

CI, build, and dependency tooling

- [CI workflows](https://github.com/khronosgroup/vulkan-tutorial/blob/main/.github/workflows/workflow.yml): github actions · Docs validation and sample build workflows · `.github/workflows/workflow.yml`
- [Tooling](https://github.com/khronosgroup/vulkan-tutorial/blob/main/scripts/install_dependencies_linux.sh): build scripts · Dependency installers and asset fetch helpers · `scripts/install_dependencies_linux.sh`

## Connections

- Antora → Nav: assembles · Antora uses navigation to build the published docs
- Nav → Tutorial docs: indexes · Navigation points into the main tutorial chapters
- Nav → Engine track: indexes · Navigation includes the engine-building track
- Nav → Ray tracing course: indexes · Navigation includes the ray tracing course
- Tutorial docs → Tutorial steps: explains · The tutorial prose maps to the numbered example progression
- Tutorial docs → Shaders: references · Tutorial chapters reference the shader sources
- Tutorial docs → Assets: references · Docs point to meshes and textures used by the examples
- Tutorial steps → Shaders: uses · Examples compile and run with tutorial shader assets
- Tutorial steps → Assets: loads · Later tutorial steps load models and textures from assets
- Engine track → Engine core: maps to · Engine chapters correspond to the sample engine implementation
- Engine core → ECS model: coordinates · Engine lifecycle drives entity/component logic
- Engine core → Resources: owns · Engine delegates GPU and asset management to resource layers
- Engine core → Render core: drives · Engine boots the renderer as a central subsystem
- Render core → Render stages: routes · Core renderer dispatches to rendering, compute, and ray-query stages
- Render core → Vulkan backend: depends on · Rendering is built on Vulkan device and swap-chain abstractions
- Render stages → Resources: binds · Render passes consume managed buffers, images, and descriptors
- Scene loading → ECS model: populates · Scene loading creates entities and components
- Scene loading → Assets: imports · Scene loading consumes model and media assets
- Subsystems → Engine core: extends · Subsystems plug into the main runtime loop
- Android app → Android bridge: calls · Android Java UI enters native code through the bridge
- Android bridge → Engine core: starts · Native bridge launches the engine runtime
- CI workflows → Antora: validates · Workflows check docs and site buildability
- CI workflows → Tooling: uses · Automation relies on dependency and asset helper scripts
- Tooling → Vulkan backend: supports · Build scripts provision the toolchain needed by native Vulkan code
