# hanskristian-work/vkd3d-proton architecture

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

- Interactive diagram: https://gitdiagram.com/hanskristian-work/vkd3d-proton
- Repository: https://github.com/hanskristian-work/vkd3d-proton

## Overview

vkd3d-proton is a Direct3D 12 implementation layered on Vulkan, intended primarily as drop-in Win32 DLLs for Wine/Proton. The principal path is an application loading the D3D12 proxy, which forwards API work to the core implementation; the core creates devices and implements resources, commands, presentation, pipelines, and ray tracing. Shader translation and developer-facing compiler/debug facilities are distinct supporting branches. The README establishes the overall Vulkan-backed product and DLL role; sampled excerpts show proxy forwarding, while several internal subsystem links are not directly evidenced and are omitted.

Main entry points: [`libs/vkd3d/device.c`](https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/vkd3d/device.c) (Device and capabilities), [`programs/vkd3d-hlsl-build/main.cpp`](https://github.com/hanskristian-work/vkd3d-proton/blob/master/programs/vkd3d-hlsl-build/main.cpp) (HLSL build tool), [`libs/d3d12/main.c`](https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/d3d12/main.c) (D3D12 proxy DLL), [`libs/d3d12core/main.c`](https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/d3d12core/main.c) (Core API DLL)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["API entry"]
  node_proxy["D3D12 proxy DLL<br/>[main.c]"]
  node_core["Core API DLL<br/>[main.c]"]
end

subgraph group_runtime["D3D12 runtime"]
  node_device["Device and capabilities<br/>[device.c]"]
  node_resources["Resources and memory<br/>[resource.c]"]
  node_commands["Command recording<br/>[command.c]"]
  node_queues["Command queues"]
  node_presentation["Swapchain<br/>[swapchain.c]"]
  node_state["Pipeline state<br/>[state.c]"]
  node_raytracing["Ray tracing"]
  node_workgraphs["Work graphs<br/>[workgraphs.c]"]
end

subgraph group_shaders["Shader translation"]
  node_shader_api["Shader API<br/>[vkd3d_shader.h]"]
  node_dxbc["DXBC translation<br/>[dxbc.c]"]
  node_dxil["DXIL translation<br/>[dxil.c]"]
  node_shader_compiler["Shader compiler CLI<br/>[main.c]"]
end

subgraph group_support["Diagnostics and tools"]
  node_debug["Debug logging<br/>[debug.c]"]
  node_platform["Platform services<br/>[platform.c]"]
  node_hlsl_build["HLSL build tool<br/>[main.cpp]"]
end

node_application(("D3D12 application"))
node_vulkan["Vulkan driver"]

node_application -->|"loads DLL"| node_proxy
node_proxy -->|"forwards API"| node_core
node_core -.->|"creates devices"| node_device
node_device -->|"uses Vulkan"| node_vulkan
node_device -.-> node_resources
node_device -.-> node_commands
node_device -.-> node_queues
node_device -.-> node_presentation
node_device -.-> node_state
node_device -.-> node_raytracing
node_device -.-> node_workgraphs
node_shader_compiler -->|"uses API"| node_shader_api
node_hlsl_build -->|"uses library"| node_dxbc
node_hlsl_build -->|"uses library"| node_dxil

click node_proxy "https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/d3d12/main.c"
click node_core "https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/d3d12core/main.c"
click node_device "https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/vkd3d/device.c"
click node_resources "https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/vkd3d/resource.c"
click node_commands "https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/vkd3d/command.c"
click node_queues "https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/vkd3d/command_queue_vkd3d_ext.c"
click node_presentation "https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/vkd3d/swapchain.c"
click node_state "https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/vkd3d/state.c"
click node_raytracing "https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/vkd3d/raytracing_pipeline.c"
click node_workgraphs "https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/vkd3d/workgraphs.c"
click node_shader_api "https://github.com/hanskristian-work/vkd3d-proton/blob/master/include/vkd3d_shader.h"
click node_dxbc "https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/vkd3d-shader/dxbc.c"
click node_dxil "https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/vkd3d-shader/dxil.c"
click node_shader_compiler "https://github.com/hanskristian-work/vkd3d-proton/blob/master/programs/vkd3d-compiler/main.c"
click node_debug "https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/vkd3d-common/debug.c"
click node_platform "https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/vkd3d-common/platform.c"
click node_hlsl_build "https://github.com/hanskristian-work/vkd3d-proton/blob/master/programs/vkd3d-hlsl-build/main.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_proxy,node_core toneBlue
class node_device,node_resources,node_commands,node_queues,node_presentation,node_state,node_raytracing,node_workgraphs toneAmber
class node_shader_api,node_dxbc,node_dxil,node_shader_compiler toneMint
class node_debug,node_platform,node_hlsl_build toneRose
class node_application,node_vulkan toneIndigo
```

## Components

### API entry

- [D3D12 proxy DLL](https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/d3d12/main.c): `libs/d3d12/main.c`
- [Core API DLL](https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/d3d12core/main.c): `libs/d3d12core/main.c`

### D3D12 runtime

- [Device and capabilities](https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/vkd3d/device.c): `libs/vkd3d/device.c`
- [Resources and memory](https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/vkd3d/resource.c): `libs/vkd3d/resource.c`
- [Command recording](https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/vkd3d/command.c): `libs/vkd3d/command.c`
- [Command queues](https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/vkd3d/command_queue_vkd3d_ext.c): `libs/vkd3d/command_queue_vkd3d_ext.c`
- [Swapchain](https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/vkd3d/swapchain.c): `libs/vkd3d/swapchain.c`
- [Pipeline state](https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/vkd3d/state.c): `libs/vkd3d/state.c`
- [Ray tracing](https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/vkd3d/raytracing_pipeline.c): `libs/vkd3d/raytracing_pipeline.c`
- [Work graphs](https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/vkd3d/workgraphs.c): `libs/vkd3d/workgraphs.c`

### Shader translation

- [Shader API](https://github.com/hanskristian-work/vkd3d-proton/blob/master/include/vkd3d_shader.h): `include/vkd3d_shader.h`
- [DXBC translation](https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/vkd3d-shader/dxbc.c): `libs/vkd3d-shader/dxbc.c`
- [DXIL translation](https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/vkd3d-shader/dxil.c): `libs/vkd3d-shader/dxil.c`
- [Shader compiler CLI](https://github.com/hanskristian-work/vkd3d-proton/blob/master/programs/vkd3d-compiler/main.c): `programs/vkd3d-compiler/main.c`

### Diagnostics and tools

- [Debug logging](https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/vkd3d-common/debug.c): `libs/vkd3d-common/debug.c`
- [Platform services](https://github.com/hanskristian-work/vkd3d-proton/blob/master/libs/vkd3d-common/platform.c): `libs/vkd3d-common/platform.c`
- [HLSL build tool](https://github.com/hanskristian-work/vkd3d-proton/blob/master/programs/vkd3d-hlsl-build/main.cpp): `programs/vkd3d-hlsl-build/main.cpp`

### Other components

- **D3D12 application**
- **Vulkan driver**

## Connections

- D3D12 application → D3D12 proxy DLL: loads DLL
- D3D12 proxy DLL → Core API DLL: forwards API (evidence: `libs/d3d12/main.c`)
- Core API DLL → Device and capabilities: creates devices
- Device and capabilities → Vulkan driver: uses Vulkan
- Device and capabilities → Resources and memory
- Device and capabilities → Command recording
- Device and capabilities → Command queues
- Device and capabilities → Swapchain
- Device and capabilities → Pipeline state
- Device and capabilities → Ray tracing
- Device and capabilities → Work graphs
- Shader compiler CLI → Shader API: uses API (evidence: `programs/vkd3d-compiler/main.c`)
- HLSL build tool → DXBC translation: uses library (evidence: `programs/vkd3d-hlsl-build/main.cpp`)
- HLSL build tool → DXIL translation: uses library (evidence: `programs/vkd3d-hlsl-build/main.cpp`)
