# hayatog/iss_pc architecture

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

- Interactive diagram: https://gitdiagram.com/hayatog/iss_pc
- Repository: https://github.com/hayatog/iss_pc

## Overview

This repository is a native PC port of inFAMOUS Second Son: the game’s CPU code runs natively, PS4 system services are reimplemented, and GPU work is translated to Vulkan. The user-facing path is configuring and launching the game, then reaching gameplay; the Qt launcher also manages saves and settings. The graph preserves the documented shader fixes and graphics features. Several runtime links are documented only at a high level; source-level detail is limited to the supplied excerpts and SOURCE INDEX.

Main entry points: [`port/gpu/shadps4/video_core/renderer_vulkan/vk_pipeline_cache.cpp`](https://github.com/hayatog/iss_pc/blob/main/port/gpu/shadps4/video_core/renderer_vulkan/vk_pipeline_cache.cpp) (Pipeline compilation), [`port/launcher/qt/app.py`](https://github.com/hayatog/iss_pc/blob/main/port/launcher/qt/app.py) (Qt launcher), [`port/src/probe.c`](https://github.com/hayatog/iss_pc/blob/main/port/src/probe.c) (Native game code), [`port/gpu/shim/tlggpu.cpp`](https://github.com/hayatog/iss_pc/blob/main/port/gpu/shim/tlggpu.cpp) (GPU shim)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launcher["Launcher and saves"]
  node_qt_launcher["Qt launcher<br/>[app.py]"]
  node_classic_launcher["Classic launcher"]
  node_save_manager["Save manager<br/>[savemanager.py]"]
  node_run_config["Run configuration<br/>[run.py]"]
  node_diagnostics["Logs and support report<br/>[report.py]"]
end

subgraph group_runtime["Native game runtime"]
  node_native_game["Native game code<br/>[probe.c]"]
  node_runtime_api["Runtime services API<br/>[runtime.h]"]
end

subgraph group_gpu["GPU translation and rendering"]
  node_gpu_commands["GPU command handling<br/>[liverpool.cpp]"]
  node_shader_frontend["Shader decoding<br/>[decode.cpp]"]
  node_shader_ir["Shader IR and passes<br/>[program.cpp]"]
  node_spirv_backend["SPIR-V emission<br/>[emit_spirv.cpp]"]
  node_pipeline_cache["Pipeline compilation"]
  node_graphics_pipeline["Graphics pipelines"]
  node_gpu_scheduler["GPU scheduling<br/>[vk_scheduler.h]"]
  node_texture_cache["Texture cache<br/>[texture_cache.cpp]"]
  node_vulkan_device["Vulkan device<br/>[vk_instance.h]"]
end

subgraph group_services["PS4 services and controls"]
  node_runtime_services["Runtime service implementations<br/>[runtime_services.c]"]
  node_gpu_shim["GPU shim<br/>[tlggpu.cpp]"]
  node_settings["Emulator settings"]
  node_backports["Backport toggles<br/>[backports.h]"]
end

subgraph group_support["Cache and diagnostics"]
  node_shader_storage[("Shader cache storage<br/>[cache_storage.cpp]")]
  node_pipeline_serialization["Pipeline persistence and warm-up"]
end

node_player(("Player"))
node_game_files["Player-owned game files"]

node_player -->|"configures and launches"| node_qt_launcher
node_player -.->|"can launch"| node_classic_launcher
node_qt_launcher -->|"starts game"| node_run_config
node_classic_launcher -->|"starts game"| node_run_config
node_qt_launcher -->|"manages saves"| node_save_manager
node_player -->|"provides own copy"| node_game_files
node_game_files -->|"supplies game code"| node_native_game
node_native_game -->|"uses runtime API"| node_runtime_api
node_native_game -->|"uses GPU interface"| node_gpu_shim
node_runtime_services -->|"implements services"| node_runtime_api
node_runtime_services -->|"uses GPU interface"| node_gpu_shim
node_gpu_shim -.->|"submits GPU work"| node_gpu_commands
node_gpu_commands -.->|"dispatches shaders"| node_shader_frontend
node_shader_frontend -.->|"translates instructions"| node_shader_ir
node_shader_ir -.->|"emits SPIR-V"| node_spirv_backend
node_pipeline_cache -->|"compiles shaders"| node_spirv_backend
node_pipeline_cache -->|"builds graphics pipelines"| node_graphics_pipeline
node_pipeline_cache -->|"loads and saves cache"| node_shader_storage
node_pipeline_serialization -->|"reads and writes blobs"| node_shader_storage
node_graphics_pipeline -->|"creates pipelines"| node_vulkan_device
node_gpu_scheduler -.->|"records GPU work"| node_vulkan_device
node_texture_cache -->|"schedules tile work"| node_gpu_scheduler
node_settings -->|"configures compilation"| node_pipeline_cache
node_backports -->|"controls shader fixes"| node_pipeline_cache
node_player -->|"requests support report"| node_diagnostics

click node_qt_launcher "https://github.com/hayatog/iss_pc/blob/main/port/launcher/qt/app.py"
click node_classic_launcher "https://github.com/hayatog/iss_pc/blob/main/port/launcher/infamous_launcher.py"
click node_save_manager "https://github.com/hayatog/iss_pc/blob/main/port/launcher/savemanager.py"
click node_run_config "https://github.com/hayatog/iss_pc/blob/main/port/run.py"
click node_native_game "https://github.com/hayatog/iss_pc/blob/main/port/src/probe.c"
click node_runtime_api "https://github.com/hayatog/iss_pc/blob/main/port/src/runtime.h"
click node_runtime_services "https://github.com/hayatog/iss_pc/blob/main/port/src/runtime_services.c"
click node_gpu_shim "https://github.com/hayatog/iss_pc/blob/main/port/gpu/shim/tlggpu.cpp"
click node_settings "https://github.com/hayatog/iss_pc/blob/main/port/gpu/shim/core/emulator_settings.h"
click node_gpu_commands "https://github.com/hayatog/iss_pc/blob/main/port/gpu/shadps4/video_core/amdgpu/liverpool.cpp"
click node_shader_frontend "https://github.com/hayatog/iss_pc/blob/main/port/gpu/shadps4/shader_recompiler/frontend/decode.cpp"
click node_shader_ir "https://github.com/hayatog/iss_pc/blob/main/port/gpu/shadps4/shader_recompiler/ir/program.cpp"
click node_spirv_backend "https://github.com/hayatog/iss_pc/blob/main/port/gpu/shadps4/shader_recompiler/backend/spirv/emit_spirv.cpp"
click node_pipeline_cache "https://github.com/hayatog/iss_pc/blob/main/port/gpu/shadps4/video_core/renderer_vulkan/vk_pipeline_cache.cpp"
click node_graphics_pipeline "https://github.com/hayatog/iss_pc/blob/main/port/gpu/shadps4/video_core/renderer_vulkan/vk_graphics_pipeline.cpp"
click node_gpu_scheduler "https://github.com/hayatog/iss_pc/blob/main/port/gpu/shadps4/video_core/renderer_vulkan/vk_scheduler.h"
click node_texture_cache "https://github.com/hayatog/iss_pc/blob/main/port/gpu/shadps4/video_core/texture_cache/texture_cache.cpp"
click node_vulkan_device "https://github.com/hayatog/iss_pc/blob/main/port/gpu/shadps4/video_core/renderer_vulkan/vk_instance.h"
click node_shader_storage "https://github.com/hayatog/iss_pc/blob/main/port/gpu/shadps4/video_core/cache_storage.cpp"
click node_pipeline_serialization "https://github.com/hayatog/iss_pc/blob/main/port/gpu/shadps4/video_core/renderer_vulkan/vk_pipeline_serialization.cpp"
click node_diagnostics "https://github.com/hayatog/iss_pc/blob/main/port/launcher/qt/report.py"
click node_backports "https://github.com/hayatog/iss_pc/blob/main/port/gpu/shadps4/common/backports.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_qt_launcher,node_classic_launcher,node_save_manager,node_run_config,node_diagnostics toneBlue
class node_native_game,node_runtime_api toneAmber
class node_gpu_commands,node_shader_frontend,node_shader_ir,node_spirv_backend,node_pipeline_cache,node_graphics_pipeline,node_gpu_scheduler,node_texture_cache,node_vulkan_device toneMint
class node_runtime_services,node_gpu_shim,node_settings,node_backports toneRose
class node_shader_storage,node_pipeline_serialization,node_player,node_game_files toneIndigo
```

## Components

### Launcher and saves

- [Qt launcher](https://github.com/hayatog/iss_pc/blob/main/port/launcher/qt/app.py): `port/launcher/qt/app.py`
- [Classic launcher](https://github.com/hayatog/iss_pc/blob/main/port/launcher/infamous_launcher.py): `port/launcher/infamous_launcher.py`
- [Save manager](https://github.com/hayatog/iss_pc/blob/main/port/launcher/savemanager.py): `port/launcher/savemanager.py`
- [Run configuration](https://github.com/hayatog/iss_pc/blob/main/port/run.py): `port/run.py`
- [Logs and support report](https://github.com/hayatog/iss_pc/blob/main/port/launcher/qt/report.py): `port/launcher/qt/report.py`

### Native game runtime

- [Native game code](https://github.com/hayatog/iss_pc/blob/main/port/src/probe.c): `port/src/probe.c`
- [Runtime services API](https://github.com/hayatog/iss_pc/blob/main/port/src/runtime.h): `port/src/runtime.h`

### GPU translation and rendering

- [GPU command handling](https://github.com/hayatog/iss_pc/blob/main/port/gpu/shadps4/video_core/amdgpu/liverpool.cpp): `port/gpu/shadps4/video_core/amdgpu/liverpool.cpp`
- [Shader decoding](https://github.com/hayatog/iss_pc/blob/main/port/gpu/shadps4/shader_recompiler/frontend/decode.cpp): `port/gpu/shadps4/shader_recompiler/frontend/decode.cpp`
- [Shader IR and passes](https://github.com/hayatog/iss_pc/blob/main/port/gpu/shadps4/shader_recompiler/ir/program.cpp): `port/gpu/shadps4/shader_recompiler/ir/program.cpp`
- [SPIR-V emission](https://github.com/hayatog/iss_pc/blob/main/port/gpu/shadps4/shader_recompiler/backend/spirv/emit_spirv.cpp): `port/gpu/shadps4/shader_recompiler/backend/spirv/emit_spirv.cpp`
- [Pipeline compilation](https://github.com/hayatog/iss_pc/blob/main/port/gpu/shadps4/video_core/renderer_vulkan/vk_pipeline_cache.cpp): `port/gpu/shadps4/video_core/renderer_vulkan/vk_pipeline_cache.cpp`
- [Graphics pipelines](https://github.com/hayatog/iss_pc/blob/main/port/gpu/shadps4/video_core/renderer_vulkan/vk_graphics_pipeline.cpp): `port/gpu/shadps4/video_core/renderer_vulkan/vk_graphics_pipeline.cpp`
- [GPU scheduling](https://github.com/hayatog/iss_pc/blob/main/port/gpu/shadps4/video_core/renderer_vulkan/vk_scheduler.h): `port/gpu/shadps4/video_core/renderer_vulkan/vk_scheduler.h`
- [Texture cache](https://github.com/hayatog/iss_pc/blob/main/port/gpu/shadps4/video_core/texture_cache/texture_cache.cpp): `port/gpu/shadps4/video_core/texture_cache/texture_cache.cpp`
- [Vulkan device](https://github.com/hayatog/iss_pc/blob/main/port/gpu/shadps4/video_core/renderer_vulkan/vk_instance.h): `port/gpu/shadps4/video_core/renderer_vulkan/vk_instance.h`

### PS4 services and controls

- [Runtime service implementations](https://github.com/hayatog/iss_pc/blob/main/port/src/runtime_services.c): `port/src/runtime_services.c`
- [GPU shim](https://github.com/hayatog/iss_pc/blob/main/port/gpu/shim/tlggpu.cpp): `port/gpu/shim/tlggpu.cpp`
- [Emulator settings](https://github.com/hayatog/iss_pc/blob/main/port/gpu/shim/core/emulator_settings.h): `port/gpu/shim/core/emulator_settings.h`
- [Backport toggles](https://github.com/hayatog/iss_pc/blob/main/port/gpu/shadps4/common/backports.h): `port/gpu/shadps4/common/backports.h`

### Cache and diagnostics

- [Shader cache storage](https://github.com/hayatog/iss_pc/blob/main/port/gpu/shadps4/video_core/cache_storage.cpp): `port/gpu/shadps4/video_core/cache_storage.cpp`
- [Pipeline persistence and warm-up](https://github.com/hayatog/iss_pc/blob/main/port/gpu/shadps4/video_core/renderer_vulkan/vk_pipeline_serialization.cpp): `port/gpu/shadps4/video_core/renderer_vulkan/vk_pipeline_serialization.cpp`

### Other components

- **Player**
- **Player-owned game files**

## Connections

- Player → Qt launcher: configures and launches (evidence: `README.md`)
- Player → Classic launcher: can launch (evidence: `README.md`)
- Qt launcher → Run configuration: starts game (evidence: `port/launcher/qt/app.py`)
- Classic launcher → Run configuration: starts game (evidence: `port/launcher/infamous_launcher.py`)
- Qt launcher → Save manager: manages saves (evidence: `port/launcher/savemanager.py`)
- Player → Player-owned game files: provides own copy (evidence: `README.md`)
- Player-owned game files → Native game code: supplies game code (evidence: `README.md`)
- Native game code → Runtime services API: uses runtime API (evidence: `port/src/probe.c`)
- Native game code → GPU shim: uses GPU interface (evidence: `port/src/probe.c`)
- Runtime service implementations → Runtime services API: implements services (evidence: `port/src/runtime_services.c`)
- Runtime service implementations → GPU shim: uses GPU interface (evidence: `port/src/runtime_services.c`)
- GPU shim → GPU command handling: submits GPU work
- GPU command handling → Shader decoding: dispatches shaders
- Shader decoding → Shader IR and passes: translates instructions
- Shader IR and passes → SPIR-V emission: emits SPIR-V
- Pipeline compilation → SPIR-V emission: compiles shaders (evidence: `port/gpu/shadps4/video_core/renderer_vulkan/vk_pipeline_cache.cpp`)
- Pipeline compilation → Graphics pipelines: builds graphics pipelines (evidence: `port/gpu/shadps4/video_core/renderer_vulkan/vk_pipeline_cache.cpp`)
- Pipeline compilation → Shader cache storage: loads and saves cache (evidence: `port/gpu/shadps4/video_core/renderer_vulkan/vk_pipeline_cache.cpp`)
- Pipeline persistence and warm-up → Shader cache storage: reads and writes blobs (evidence: `port/gpu/shadps4/video_core/renderer_vulkan/vk_pipeline_serialization.cpp`)
- Graphics pipelines → Vulkan device: creates pipelines (evidence: `port/gpu/shadps4/video_core/renderer_vulkan/vk_graphics_pipeline.cpp`)
- GPU scheduling → Vulkan device: records GPU work
- Texture cache → GPU scheduling: schedules tile work
- Emulator settings → Pipeline compilation: configures compilation (evidence: `port/gpu/shadps4/video_core/renderer_vulkan/vk_pipeline_cache.cpp`)
- Backport toggles → Pipeline compilation: controls shader fixes (evidence: `port/gpu/shadps4/video_core/renderer_vulkan/vk_pipeline_cache.cpp`)
- Player → Logs and support report: requests support report (evidence: `README.md`)
