# sancyan/falconengine architecture

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

- Interactive diagram: https://gitdiagram.com/sancyan/falconengine
- Repository: https://github.com/sancyan/falconengine

## Overview

#### Purpose and Entry Points
This is a documentation-first Khronos Vulkan Tutorial repository, published through Antora and backed by progressively complete C++/Vulkan examples. Primary content starts at `en/00_Introduction.adoc`; documentation navigation is defined in `antora/modules/ROOT/nav.adoc` and built from `antora/antora.yml`. Runnable sample entry points include chapter snapshots in `attachments/*.cpp` and the engine executable at `attachments/simple_engine/main.cpp`.

#### Tutorial Progression and Reference Implementations
The main tutorial is a staged learning path: Vulkan setup, presentation, pipeline creation, command submission, resource uploads, textures/models, compute, platform support, multithreading, and ray tracing. Each numbered attachment represents a self-contained implementation stage, rather than a shared production library. Representative endpoints are `attachments/00_base_code.cpp`, `attachments/15_hello_triangle.cpp`, and `attachments/38_ray_tracing.cpp`; their paired Slang/GLSL shader sources sit alongside relevant stages.

#### Vulkan Runtime Boundary
Examples target Vulkan 1.4 concepts with Vulkan-Hpp RAII, dynamic rendering, timeline semaphores, and Slang as the primary shader language. The central boundary is application-side C++ submitting GPU work through Vulkan devices, queues, swapchains, command buffers, descriptors, and pipelines. Build/dependency discovery is rooted in `attachments/CMakeLists.txt`, `attachments/CMake/FindVulkanHpp.cmake`, and `attachments/CMake/FindVulkan.cmake`.

#### Rendering Data Flow
The tutorial’s canonical frame flow is: create instance/device/surface; select presentation configuration; create swapchain image views; assemble shaders and graphics pipeline; record commands; acquire-render-present; recreate swapchain when invalidated. This maps directly to `attachments/04_logical_device.cpp`, `attachments/06_swap_chain_creation.cpp`, and `attachments/17_swap_chain_recreation.cpp`. GPU asset flow extends from CPU staging buffers through vertex/index/uniform/texture resources to descriptor-bound shaders, e.g. `attachments/20_staging_buffer.cpp`, `attachments/23_descriptor_sets.cpp`, and `attachments/29_mipmapping.cpp`.

#### Simple Engine Architecture
`attachments/simple_engine/` is the advanced, integrated reference application behind the “Building a Simple Engine” course. `attachments/simple_engine/engine.cpp` coordinates platform, scene, subsystem, and renderer lifecycle; `attachments/simple_engine/main.cpp` launches it. Entity/component state is modeled by `attachments/simple_engine/entity.cpp`, `attachments/simple_engine/component.h`, and specialized components such as transforms, meshes, cameras, and animation.

#### Engine Rendering and Assets
The engine separates Vulkan-device/platform ownership from renderer implementation and pipeline/resource management. Core rendering is distributed across `attachments/simple_engine/renderer_core.cpp`, `attachments/simple_engine/renderer_rendering.cpp`, and `attachments/simple_engine/renderer_rendergraph.h`; compute and ray-query paths are in `attachments/simple_engine/renderer_compute.cpp` and `attachments/simple_engine/renderer_ray_query.cpp`. Scene/model ingestion and resource ownership are bounded by `attachments/simple_engine/scene_loading.cpp`, `attachments/simple_engine/model_loader.cpp`, and `attachments/simple_engine/resource_manager.cpp`. Slang shaders, including PBR, culling, lighting, and ray-query code, reside in `attachments/simple_engine/shaders/`.

#### Platforms, Dependencies, and Automation
Desktop samples use CMake/C++20 and external Vulkan SDK, GLFW, GLM, stb, tinyobjloader, KTX, and glTF-related dependencies. Android packaging bridges Java activity lifecycle to native Vulkan/CMake code at `attachments/android/app/src/main/java/com/vulkan/tutorial/VulkanActivity.java` and `attachments/android/app/src/main/cpp/game_activity_bridge.cpp`; the engine has an equivalent Android target under `attachments/simple_engine/android/`. GitHub Actions build documentation, quality checks, and the simple engine via `.github/workflows/build-antora-doc.yml`, `.github/workflows/quality-checks.yml`, and `.github/workflows/simple_engine_ci.yml`.

Main entry points: [`attachments/simple_engine/renderer_core.cpp`](https://github.com/sancyan/falconengine/blob/main/attachments/simple_engine/renderer_core.cpp) (Renderer core), [`attachments/simple_engine/engine.cpp`](https://github.com/sancyan/falconengine/blob/main/attachments/simple_engine/engine.cpp) (Engine lifecycle), [`attachments/00_base_code.cpp`](https://github.com/sancyan/falconengine/blob/main/attachments/00_base_code.cpp) (Chapter snapshots), [`attachments/simple_engine/main.cpp`](https://github.com/sancyan/falconengine/blob/main/attachments/simple_engine/main.cpp) (Engine executable)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_docs["Documentation"]
  node_intro["Tutorial introduction<br/>Asciidoc content"]
  node_nav["Documentation navigation<br/>Antora navigation<br/>[nav.adoc]"]
  node_antora["Antora site build<br/>Antora config<br/>[antora.yml]"]
end

subgraph group_samples["Tutorial Samples"]
  node_sample_stages["Chapter snapshots<br/>C++ Vulkan samples<br/>[00_base_code.cpp]"]
  node_triangle["Triangle stage<br/>C++ Vulkan sample"]
  node_ray_tracing["Ray tracing stage<br/>C++ Vulkan sample<br/>[38_ray_tracing.cpp]"]
  node_device_setup["Device setup<br/>Vulkan sample stage"]
  node_swapchain["Swapchain lifecycle<br/>Vulkan sample stages"]
  node_asset_upload["GPU resource flow<br/>Vulkan sample stages"]
end

subgraph group_engine["Simple Engine"]
  node_engine_main["Engine executable<br/>C++ entry point<br/>[main.cpp]"]
  node_engine_lifecycle["Engine lifecycle<br/>Engine coordinator<br/>[engine.cpp]"]
  node_ecs["Entity components<br/>Scene state<br/>[entity.cpp]"]
  node_scene_assets["Scene and resources<br/>Asset ingestion<br/>[scene_loading.cpp]"]
  node_renderer["Renderer core<br/>Vulkan renderer<br/>[renderer_core.cpp]"]
  node_advanced_gpu["Compute and ray query<br/>Renderer paths"]
  node_engine_shaders["Engine shaders<br/>Slang shaders"]
end

subgraph group_platform["Build &amp; Platforms"]
  node_cmake["Sample build discovery<br/>CMake build<br/>[CMakeLists.txt]"]
  node_android_bridge["Android native bridge<br/>Android integration"]
end

subgraph group_automation["CI"]
  node_ci["Simple engine CI<br/>GitHub Actions workflow"]
end

node_antora -->|"uses"| node_nav
node_nav -->|"links"| node_intro
node_intro -->|"teaches through"| node_sample_stages
node_sample_stages -->|"progresses to"| node_device_setup
node_device_setup -->|"configures presentation"| node_swapchain
node_swapchain -->|"enables frame rendering"| node_triangle
node_triangle -->|"extends with resources"| node_asset_upload
node_asset_upload -->|"advances to"| node_ray_tracing
node_cmake -->|"builds"| node_sample_stages
node_android_bridge -.->|"hosts on Android"| node_sample_stages
node_engine_main -->|"launches"| node_engine_lifecycle
node_engine_lifecycle -->|"updates"| node_ecs
node_engine_lifecycle -->|"loads"| node_scene_assets
node_engine_lifecycle -->|"drives frames"| node_renderer
node_scene_assets -->|"provides assets"| node_renderer
node_ecs -->|"provides scene state"| node_renderer
node_renderer -->|"includes"| node_advanced_gpu
node_renderer -->|"binds"| node_engine_shaders
node_cmake -->|"builds"| node_engine_main
node_ci -->|"builds"| node_engine_main

click node_intro "https://github.com/sancyan/falconengine/blob/main/en/00_Introduction.adoc"
click node_nav "https://github.com/sancyan/falconengine/blob/main/antora/modules/ROOT/nav.adoc"
click node_antora "https://github.com/sancyan/falconengine/blob/main/antora/antora.yml"
click node_sample_stages "https://github.com/sancyan/falconengine/blob/main/attachments/00_base_code.cpp"
click node_triangle "https://github.com/sancyan/falconengine/blob/main/attachments/15_hello_triangle.cpp"
click node_ray_tracing "https://github.com/sancyan/falconengine/blob/main/attachments/38_ray_tracing.cpp"
click node_device_setup "https://github.com/sancyan/falconengine/blob/main/attachments/04_logical_device.cpp"
click node_swapchain "https://github.com/sancyan/falconengine/blob/main/attachments/06_swap_chain_creation.cpp"
click node_asset_upload "https://github.com/sancyan/falconengine/blob/main/attachments/20_staging_buffer.cpp"
click node_engine_main "https://github.com/sancyan/falconengine/blob/main/attachments/simple_engine/main.cpp"
click node_engine_lifecycle "https://github.com/sancyan/falconengine/blob/main/attachments/simple_engine/engine.cpp"
click node_ecs "https://github.com/sancyan/falconengine/blob/main/attachments/simple_engine/entity.cpp"
click node_scene_assets "https://github.com/sancyan/falconengine/blob/main/attachments/simple_engine/scene_loading.cpp"
click node_renderer "https://github.com/sancyan/falconengine/blob/main/attachments/simple_engine/renderer_core.cpp"
click node_advanced_gpu "https://github.com/sancyan/falconengine/blob/main/attachments/simple_engine/renderer_compute.cpp"
click node_cmake "https://github.com/sancyan/falconengine/blob/main/attachments/CMakeLists.txt"
click node_android_bridge "https://github.com/sancyan/falconengine/blob/main/attachments/android/app/src/main/cpp/game_activity_bridge.cpp"
click node_ci "https://github.com/sancyan/falconengine/blob/main/.github/workflows/simple_engine_ci.yml"

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_intro,node_nav,node_antora toneBlue
class node_sample_stages,node_triangle,node_ray_tracing,node_device_setup,node_swapchain,node_asset_upload toneAmber
class node_engine_main,node_engine_lifecycle,node_ecs,node_scene_assets,node_renderer,node_advanced_gpu,node_engine_shaders toneMint
class node_cmake,node_android_bridge toneRose
class node_ci toneIndigo
```

## Components

### Documentation

Antora-published tutorial content.

- [Tutorial introduction](https://github.com/sancyan/falconengine/blob/main/en/00_Introduction.adoc): Asciidoc content · `en/00_Introduction.adoc`
- [Documentation navigation](https://github.com/sancyan/falconengine/blob/main/antora/modules/ROOT/nav.adoc): Antora navigation · `antora/modules/ROOT/nav.adoc`
- [Antora site build](https://github.com/sancyan/falconengine/blob/main/antora/antora.yml): Antora config · `antora/antora.yml`

### Tutorial Samples

Progressive standalone Vulkan implementations.

- [Chapter snapshots](https://github.com/sancyan/falconengine/blob/main/attachments/00_base_code.cpp): C++ Vulkan samples · Each numbered source is a self-contained tutorial stage. · `attachments/00_base_code.cpp`
- [Triangle stage](https://github.com/sancyan/falconengine/blob/main/attachments/15_hello_triangle.cpp): C++ Vulkan sample · `attachments/15_hello_triangle.cpp`
- [Ray tracing stage](https://github.com/sancyan/falconengine/blob/main/attachments/38_ray_tracing.cpp): C++ Vulkan sample · `attachments/38_ray_tracing.cpp`
- [Device setup](https://github.com/sancyan/falconengine/blob/main/attachments/04_logical_device.cpp): Vulkan sample stage · `attachments/04_logical_device.cpp`
- [Swapchain lifecycle](https://github.com/sancyan/falconengine/blob/main/attachments/06_swap_chain_creation.cpp): Vulkan sample stages · Creates presentation images and recreates invalidated swapchains. · `attachments/06_swap_chain_creation.cpp`
- [GPU resource flow](https://github.com/sancyan/falconengine/blob/main/attachments/20_staging_buffer.cpp): Vulkan sample stages · Stages assets into descriptor-bound buffers and textures. · `attachments/20_staging_buffer.cpp`

### Simple Engine

Integrated advanced reference application.

- [Engine executable](https://github.com/sancyan/falconengine/blob/main/attachments/simple_engine/main.cpp): C++ entry point · `attachments/simple_engine/main.cpp`
- [Engine lifecycle](https://github.com/sancyan/falconengine/blob/main/attachments/simple_engine/engine.cpp): Engine coordinator · Coordinates platform, scene, subsystems, and renderer. · `attachments/simple_engine/engine.cpp`
- [Entity components](https://github.com/sancyan/falconengine/blob/main/attachments/simple_engine/entity.cpp): Scene state · Entities compose transform, mesh, camera, and animation state. · `attachments/simple_engine/entity.cpp`
- [Scene and resources](https://github.com/sancyan/falconengine/blob/main/attachments/simple_engine/scene_loading.cpp): Asset ingestion · Loads models and owns scene GPU resources. · `attachments/simple_engine/scene_loading.cpp`
- [Renderer core](https://github.com/sancyan/falconengine/blob/main/attachments/simple_engine/renderer_core.cpp): Vulkan renderer · Owns rendering implementation, pipelines, and render graph. · `attachments/simple_engine/renderer_core.cpp`
- [Compute and ray query](https://github.com/sancyan/falconengine/blob/main/attachments/simple_engine/renderer_compute.cpp): Renderer paths · `attachments/simple_engine/renderer_compute.cpp`
- **Engine shaders**: Slang shaders · PBR, culling, lighting, and ray-query shader programs.

### Build & Platforms

- [Sample build discovery](https://github.com/sancyan/falconengine/blob/main/attachments/CMakeLists.txt): CMake build · Finds Vulkan and Vulkan-Hpp dependencies for desktop samples. · `attachments/CMakeLists.txt`
- [Android native bridge](https://github.com/sancyan/falconengine/blob/main/attachments/android/app/src/main/cpp/game_activity_bridge.cpp): Android integration · Bridges Java activity lifecycle to native Vulkan code. · `attachments/android/app/src/main/cpp/game_activity_bridge.cpp`

### CI

- [Simple engine CI](https://github.com/sancyan/falconengine/blob/main/.github/workflows/simple_engine_ci.yml): GitHub Actions workflow · `.github/workflows/simple_engine_ci.yml`

## Connections

- Antora site build → Documentation navigation: uses
- Documentation navigation → Tutorial introduction: links
- Tutorial introduction → Chapter snapshots: teaches through
- Chapter snapshots → Device setup: progresses to
- Device setup → Swapchain lifecycle: configures presentation
- Swapchain lifecycle → Triangle stage: enables frame rendering
- Triangle stage → GPU resource flow: extends with resources
- GPU resource flow → Ray tracing stage: advances to
- Sample build discovery → Chapter snapshots: builds
- Android native bridge → Chapter snapshots: hosts on Android
- Engine executable → Engine lifecycle: launches
- Engine lifecycle → Entity components: updates
- Engine lifecycle → Scene and resources: loads
- Engine lifecycle → Renderer core: drives frames
- Scene and resources → Renderer core: provides assets
- Entity components → Renderer core: provides scene state
- Renderer core → Compute and ray query: includes
- Renderer core → Engine shaders: binds
- Sample build discovery → Engine executable: builds
- Simple engine CI → Engine executable: builds
