# aemreaydin/forge architecture

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

- Interactive diagram: https://gitdiagram.com/aemreaydin/forge
- Repository: https://github.com/aemreaydin/forge

## Overview

##### Component Details

For each major component, include:
- Component name
- Key responsibilities
- Critical dependencies

Example structure:
**[GLFW Window Manager] → [Surface] ← [Vulkan Instance]**
- ↓
- [Physical Device]
- ↓
- [Logical Device] → [Buffer Manager]
- ↓
- [Swapchain] → [Shader Objects]

##### Technical Details

Annotations for:
- Vulkan version support (1.0+)
- Validation layer integration points
- Cross-platform compatibility notes
- MoltenVK integration for macOS

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph External
        GLFW[GLFW Window System]:::external
        VulkanSDK[Vulkan SDK]:::external
    end

    subgraph Core["Core Vulkan Components"]
        Instance[Instance]:::core
        PhysicalDevice[Physical Device]:::core
        LogicalDevice[Logical Device]:::core
        Surface[Surface]:::core
        Swapchain[Swapchain]:::core
    end

    subgraph Resources["Resource Management"]
        BufferMgr[Buffer Manager]:::resource
        ShaderObj[Shader Objects]:::resource
    end

    subgraph ShaderPipeline["Shader Pipeline"]
        VertShader[Vertex Shader]:::shader
        FragShader[Fragment Shader]:::shader
        SPIRVBin[SPIRV Binary]:::shader
    end

    subgraph EntryPoints["Entry Points"]
        LibEntry[Library Entry]:::entry
        TestImpl[Example Implementation]:::entry
    end

    %% Core Component Relationships
    VulkanSDK --> Instance
    Instance --> PhysicalDevice
    PhysicalDevice --> LogicalDevice
    GLFW --> Surface
    Surface --> Instance
    LogicalDevice --> Swapchain
    Surface --> Swapchain

    %% Resource Management
    LogicalDevice --> BufferMgr
    LogicalDevice --> ShaderObj
    
    %% Shader Pipeline
    VertShader --> SPIRVBin
    FragShader --> SPIRVBin
    SPIRVBin --> ShaderObj

    %% Entry Points
    LibEntry --> Instance
    TestImpl --> LibEntry

    %% Click Events
    click Instance "https://github.com/aemreaydin/forge/blob/main/src/instance.rs"
    click PhysicalDevice "https://github.com/aemreaydin/forge/blob/main/src/physical_device.rs"
    click LogicalDevice "https://github.com/aemreaydin/forge/blob/main/src/device.rs"
    click Surface "https://github.com/aemreaydin/forge/blob/main/src/surface.rs"
    click Swapchain "https://github.com/aemreaydin/forge/blob/main/src/swapchain.rs"
    click BufferMgr "https://github.com/aemreaydin/forge/blob/main/src/buffer.rs"
    click ShaderObj "https://github.com/aemreaydin/forge/blob/main/src/shader_object.rs"
    click VertShader "https://github.com/aemreaydin/forge/blob/main/shaders/triangle.vert.glsl"
    click FragShader "https://github.com/aemreaydin/forge/blob/main/shaders/triangle.frag.glsl"
    click TestImpl "https://github.com/aemreaydin/forge/blob/main/examples/testbed.rs"
    click LibEntry "https://github.com/aemreaydin/forge/blob/main/src/lib.rs"

    %% Styling
    classDef external fill:#gray,stroke:#333,stroke-width:2px
    classDef core fill:#a8d1f0,stroke:#333,stroke-width:2px
    classDef resource fill:#90EE90,stroke:#333,stroke-width:2px
    classDef shader fill:#FFB6C1,stroke:#333,stroke-width:2px
    classDef entry fill:#DDA0DD,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        L1[External Dependencies]:::external
        L2[Core Components]:::core
        L3[Resource Management]:::resource
        L4[Shader Components]:::shader
        L5[Entry Points]:::entry
    end
```
