How khronosgroup/vulkan-tutorial works
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: engine.cpp Engine core · nav.adoc Nav · 00_Base_code.adoc Tutorial docs · 00_base_code.cpp Tutorial steps
Components 20
Docs site
AsciiDoc sources and Antora site assembly
- Antora · Static-site generation pipeline for the documentation
antora-ci-playbook.yml - Nav · Antora navigation that defines the published content structure
antora/modules/ROOT/nav.adoc - Tutorial docs · Main Vulkan tutorial chapters under en/
en/03_Drawing_a_triangle/00_Setup/00_Base_code.adoc - Engine track · Building a Simple Engine chapter set
en/Building_a_Simple_Engine/introduction.adoc - Ray tracing 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 · Numbered examples that evolve the core Vulkan tutorial
attachments/00_base_code.cpp - Shaders · Representative shader set used across tutorial stages
attachments/09_shader_base.slang - Assets · Meshes, textures, and other tutorial runtime assets
attachments/assets/viking_room.glb
Simple engine
Component-based engine sample and Vulkan rendering stack
- Engine core · Main engine entry point and lifecycle orchestration
attachments/simple_engine/engine.cpp - ECS model · Entity, component, and transform/camera/mesh systems
attachments/simple_engine/entity.cpp - Resources · Resource and descriptor management for GPU assets
attachments/simple_engine/resource_manager.cpp - Render core · Renderer orchestration and core rendering flow
attachments/simple_engine/renderer_core.cpp - Render stages · Pipelines for rendering, compute, and ray-query paths
attachments/simple_engine/renderer_rendering.cpp - Vulkan backend · Device, dispatch, swap-chain, and pipeline setup layers
attachments/simple_engine/vulkan_device.cpp - Scene loading · Scene and model loading into the engine runtime
attachments/simple_engine/scene_loading.cpp - Subsystems · ImGui UI, audio, and physics subsystems
attachments/simple_engine/imgui_system.cpp
Platform bridges
Android entry points and native bridge code
- Android bridge · Java activity to native C++ bridge for Android builds
attachments/simple_engine/android/app/src/main/cpp/game_activity_bridge.cpp - Android app · 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 · Docs validation and sample build workflows
.github/workflows/workflow.yml - Tooling · Dependency installers and asset fetch helpers
scripts/install_dependencies_linux.sh
Connections 24
- 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