# alexainc/reshade-ff-chams architecture

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

- Interactive diagram: https://gitdiagram.com/alexainc/reshade-ff-chams
- Repository: https://github.com/alexainc/reshade-ff-chams

## Overview

ReShade injects into graphics applications, intercepts rendering APIs, and provides a runtime for applying ReShade FX effects and managing presets. The runtime workflow also includes an overlay and optional add-ons. The graph preserves the documented compiler stages and major API families; source-level evidence was sampled only for selected hook and add-on components, so broader connections rely on README statements.

Main entry points: [`source/runtime.cpp`](https://github.com/alexainc/reshade-ff-chams/blob/main/source/runtime.cpp) (Effect runtime), [`source/hook_manager.cpp`](https://github.com/alexainc/reshade-ff-chams/blob/main/source/hook_manager.cpp) (Hook manager), [`source/effect_parser_stmt.cpp`](https://github.com/alexainc/reshade-ff-chams/blob/main/source/effect_parser_stmt.cpp) (FX parser), [`source/runtime_gui.cpp`](https://github.com/alexainc/reshade-ff-chams/blob/main/source/runtime_gui.cpp) (Runtime overlay)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_injection["Injection and hooks"]
  node_entry["DLL entry<br/>[dll_main.cpp]"]
  node_hook_manager["Hook manager<br/>[hook_manager.cpp]"]
  node_hook_impl["Hook implementation<br/>[hook.cpp]"]
end

subgraph group_graphics["Graphics integration"]
  node_api_hooks["Graphics API hooks"]
  node_d3d11_context["D3D11 context"]
  node_vulkan_hooks["Vulkan hooks"]
end

subgraph group_runtime["Runtime and effects"]
  node_runtime["Effect runtime<br/>[runtime.cpp]"]
  node_runtime_manager["Runtime manager"]
  node_shader_lexer["FX lexer<br/>[effect_lexer.cpp]"]
  node_shader_preprocessor["FX preprocessor"]
  node_shader_parser["FX parser"]
  node_shader_expressions["FX expressions"]
  node_shader_codegen["FX code generators"]
  node_config["Presets and config<br/>[ini_file.cpp]"]
end

subgraph group_extensions["Extensions and API"]
  node_public_api["ReShade API<br/>[reshade_api.hpp]"]
  node_events["Addon events<br/>[reshade_events.hpp]"]
  node_addon_manager["Addon manager<br/>[addon_manager.cpp]"]
end

subgraph group_interface["User interface"]
  node_overlay["Runtime overlay<br/>[runtime_gui.cpp]"]
  node_input["Input handling<br/>[input.cpp]"]
end

node_game(("Graphics application"))
node_user(("Player"))

node_game -->|"loads into"| node_entry
node_entry -.->|"sets up hooks"| node_hook_manager
node_hook_manager -->|"installs hooks"| node_hook_impl
node_hook_manager -.->|"hooks exports"| node_api_hooks
node_api_hooks -.->|"provides rendering access"| node_runtime
node_d3d11_context -->|"invokes callbacks"| node_events
node_vulkan_hooks -->|"invokes callbacks"| node_events
node_runtime -.->|"compiles effects"| node_shader_lexer
node_runtime -->|"manages presets"| node_config
node_shader_lexer -.->|"processes source"| node_shader_preprocessor
node_shader_preprocessor -.->|"prepares source"| node_shader_parser
node_shader_parser -.->|"parses expressions"| node_shader_expressions
node_shader_parser -.->|"generates shaders"| node_shader_codegen
node_runtime -->|"uses compiler"| node_shader_codegen
node_addon_manager -->|"loads extensions"| node_public_api
node_addon_manager -->|"registers callbacks"| node_events
node_user -->|"configures effects"| node_overlay
node_overlay -.->|"controls runtime"| node_runtime
node_input -.->|"supplies input"| node_overlay

click node_entry "https://github.com/alexainc/reshade-ff-chams/blob/main/source/dll_main.cpp"
click node_hook_manager "https://github.com/alexainc/reshade-ff-chams/blob/main/source/hook_manager.cpp"
click node_hook_impl "https://github.com/alexainc/reshade-ff-chams/blob/main/source/hook.cpp"
click node_api_hooks "https://github.com/alexainc/reshade-ff-chams/tree/main/source"
click node_d3d11_context "https://github.com/alexainc/reshade-ff-chams/blob/main/source/d3d11/d3d11_device_context.cpp"
click node_vulkan_hooks "https://github.com/alexainc/reshade-ff-chams/blob/main/source/vulkan/vulkan_hooks_device.cpp"
click node_runtime "https://github.com/alexainc/reshade-ff-chams/blob/main/source/runtime.cpp"
click node_runtime_manager "https://github.com/alexainc/reshade-ff-chams/blob/main/source/runtime_manager.cpp"
click node_shader_lexer "https://github.com/alexainc/reshade-ff-chams/blob/main/source/effect_lexer.cpp"
click node_shader_preprocessor "https://github.com/alexainc/reshade-ff-chams/blob/main/source/effect_preprocessor.cpp"
click node_shader_parser "https://github.com/alexainc/reshade-ff-chams/blob/main/source/effect_parser_stmt.cpp"
click node_shader_expressions "https://github.com/alexainc/reshade-ff-chams/blob/main/source/effect_expression.cpp"
click node_shader_codegen "https://github.com/alexainc/reshade-ff-chams/tree/main/source"
click node_config "https://github.com/alexainc/reshade-ff-chams/blob/main/source/ini_file.cpp"
click node_public_api "https://github.com/alexainc/reshade-ff-chams/blob/main/include/reshade_api.hpp"
click node_events "https://github.com/alexainc/reshade-ff-chams/blob/main/include/reshade_events.hpp"
click node_addon_manager "https://github.com/alexainc/reshade-ff-chams/blob/main/source/addon_manager.cpp"
click node_overlay "https://github.com/alexainc/reshade-ff-chams/blob/main/source/runtime_gui.cpp"
click node_input "https://github.com/alexainc/reshade-ff-chams/blob/main/source/input.cpp"

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_entry,node_hook_manager,node_hook_impl toneBlue
class node_api_hooks,node_d3d11_context,node_vulkan_hooks toneAmber
class node_runtime,node_runtime_manager,node_shader_lexer,node_shader_preprocessor,node_shader_parser,node_shader_expressions,node_shader_codegen,node_config toneMint
class node_public_api,node_events,node_addon_manager toneRose
class node_overlay,node_input,node_game,node_user toneIndigo
```

## Components

### Injection and hooks

- [DLL entry](https://github.com/alexainc/reshade-ff-chams/blob/main/source/dll_main.cpp): `source/dll_main.cpp`
- [Hook manager](https://github.com/alexainc/reshade-ff-chams/blob/main/source/hook_manager.cpp): `source/hook_manager.cpp`
- [Hook implementation](https://github.com/alexainc/reshade-ff-chams/blob/main/source/hook.cpp): `source/hook.cpp`

### Graphics integration

- [Graphics API hooks](https://github.com/alexainc/reshade-ff-chams/tree/main/source): `source`
- [D3D11 context](https://github.com/alexainc/reshade-ff-chams/blob/main/source/d3d11/d3d11_device_context.cpp): `source/d3d11/d3d11_device_context.cpp`
- [Vulkan hooks](https://github.com/alexainc/reshade-ff-chams/blob/main/source/vulkan/vulkan_hooks_device.cpp): `source/vulkan/vulkan_hooks_device.cpp`

### Runtime and effects

- [Effect runtime](https://github.com/alexainc/reshade-ff-chams/blob/main/source/runtime.cpp): `source/runtime.cpp`
- [Runtime manager](https://github.com/alexainc/reshade-ff-chams/blob/main/source/runtime_manager.cpp): `source/runtime_manager.cpp`
- [FX lexer](https://github.com/alexainc/reshade-ff-chams/blob/main/source/effect_lexer.cpp): `source/effect_lexer.cpp`
- [FX preprocessor](https://github.com/alexainc/reshade-ff-chams/blob/main/source/effect_preprocessor.cpp): `source/effect_preprocessor.cpp`
- [FX parser](https://github.com/alexainc/reshade-ff-chams/blob/main/source/effect_parser_stmt.cpp): `source/effect_parser_stmt.cpp`
- [FX expressions](https://github.com/alexainc/reshade-ff-chams/blob/main/source/effect_expression.cpp): `source/effect_expression.cpp`
- [FX code generators](https://github.com/alexainc/reshade-ff-chams/tree/main/source): `source`
- [Presets and config](https://github.com/alexainc/reshade-ff-chams/blob/main/source/ini_file.cpp): `source/ini_file.cpp`

### Extensions and API

- [ReShade API](https://github.com/alexainc/reshade-ff-chams/blob/main/include/reshade_api.hpp): `include/reshade_api.hpp`
- [Addon events](https://github.com/alexainc/reshade-ff-chams/blob/main/include/reshade_events.hpp): `include/reshade_events.hpp`
- [Addon manager](https://github.com/alexainc/reshade-ff-chams/blob/main/source/addon_manager.cpp): `source/addon_manager.cpp`

### User interface

- [Runtime overlay](https://github.com/alexainc/reshade-ff-chams/blob/main/source/runtime_gui.cpp): `source/runtime_gui.cpp`
- [Input handling](https://github.com/alexainc/reshade-ff-chams/blob/main/source/input.cpp): `source/input.cpp`

### Other components

- **Graphics application**
- **Player**

## Connections

- Graphics application → DLL entry: loads into (evidence: `README.md`)
- DLL entry → Hook manager: sets up hooks
- Hook manager → Hook implementation: installs hooks (evidence: `source/hook_manager.cpp`)
- Hook manager → Graphics API hooks: hooks exports (evidence: `source/hook_manager.cpp`)
- Graphics API hooks → Effect runtime: provides rendering access
- D3D11 context → Addon events: invokes callbacks (evidence: `source/d3d11/d3d11_device_context.cpp`)
- Vulkan hooks → Addon events: invokes callbacks (evidence: `source/vulkan/vulkan_hooks_device.cpp`)
- Effect runtime → FX lexer: compiles effects
- Effect runtime → Presets and config: manages presets (evidence: `README.md`)
- FX lexer → FX preprocessor: processes source
- FX preprocessor → FX parser: prepares source
- FX parser → FX expressions: parses expressions
- FX parser → FX code generators: generates shaders
- Effect runtime → FX code generators: uses compiler (evidence: `README.md`)
- Addon manager → ReShade API: loads extensions (evidence: `source/addon_manager.cpp`)
- Addon manager → Addon events: registers callbacks
- Player → Runtime overlay: configures effects (evidence: `README.md`)
- Runtime overlay → Effect runtime: controls runtime
- Input handling → Runtime overlay: supplies input
