memkit-gpu 0.2.0-beta.1

Backend-agnostic GPU memory management for memkit
<div align="center">

# ◈ MEMKIT GPU ◈


### `[ HARDWARE-AGNOSTIC GPU MEMORY LAYER ]`


[![Crates.io](https://img.shields.io/badge/crates.io-v0.2.0--beta.1-00ff9f?style=for-the-badge&labelColor=0d1117)](https://crates.io/crates/memkit-gpu)
[![Documentation](https://img.shields.io/badge/docs.rs-memkit--gpu-ff00ff?style=for-the-badge&labelColor=0d1117)](https://docs.rs/memkit-gpu)
[![License](https://img.shields.io/badge/license-MPL--2.0-ff6b35?style=for-the-badge&labelColor=0d1117)](../LICENSE.md)

---

```
 ██████╗ ██████╗ ██╗   ██╗
██╔════╝ ██╔══██╗██║   ██║
██║  ███╗██████╔╝██║   ██║
██║   ██║██╔═══╝ ██║   ██║
╚██████╔╝██║     ╚██████╔╝
 ╚═════╝ ╚═╝      ╚═════╝ 
```

> *"Heterogeneous memory management without the friction."*

**Type-safe, backend-agnostic GPU memory management for the Memkit ecosystem. Bridge the gap between CPU-visible staging and device-local hardware memory.**

[`◈ QUICK START`](#◈-quick-start) • [`◈ BACKENDS`](#◈-supported-backends) • [`◈ ARCHITECTURE`](#◈-architecture)

</div>

---

## ◈ THE GPU ADVANTAGE


| Feature | Standard Global | Memkit GPU | Results |
|:--------|:---------------:|:----------:|:--------|
| **Latency** | Jitter-prone | **Deterministic** | Frame consistency |
| **Backend** | Native-only | **Multi-backend** | Cross-platform |
| **Safety** | Manual pointers | **Type-safe** | No memory leaks |
| **Transfers** | Ad-hoc | **Batched** | Minimized stalls |

---

## ◈ FEATURES


```
┌─────────────────────────────────────────────────────────────────────────┐
│  ◆ STAGING     │  Explicit management of CPU-visible memory. Optimized  │
│                │  for fast uploads and data streaming.                   │
├─────────────────────────────────────────────────────────────────────────┤
│  ◆ DEVICE      │  GPU-local memory allocation. Type-safe buffers for    │
│                │  Vertices, Indices, and Unifroms.                      │
├─────────────────────────────────────────────────────────────────────────┤
│  ◆ BATCHING    │  Coalesced transfers to minimize command buffer        │
│                │  recording overhead.                                   │
└─────────────────────────────────────────────────────────────────────────┘
```

---

## ◈ QUICK START


```rust
use memkit_gpu::{MkGpu, MkBufferUsage, DummyBackend};

// Initialize with Dummy backend for simulation
let gpu = MkGpu::new(DummyBackend::new());

// Create staging buffer (CPU-visible)
let vertices: &[f32] = &[0.0, 1.0, 0.0, 1.0, 0.0, 0.0];
let staging = gpu.staging_buffer_with_data(vertices).unwrap();

// Create device-local buffer (GPU-fast)
let device = gpu.create_device_buffer(
    std::mem::size_of_val(vertices),
    MkBufferUsage::VERTEX | MkBufferUsage::TRANSFER_DST,
).unwrap();

// Batch transfer from Staging to Device
gpu.transfer(&staging, &device).unwrap();
```

---

## ◈ SUPPORTED BACKENDS


| Backend | Feature Flag | Status |
|:--------|:------------:|:-------|
| **Vulkan** | `vulkan` | **PRODUCTION READY** |
| **Dummy** | (default) | **TEST READY** |
| **Metal** | `metal` | 🚧 COMING SOON |
| **DX12** | `dx12` | 🚧 COMING SOON |

To enable Vulkan:
```toml
memkit-gpu = { version = "0.2.0-beta.1", features = ["vulkan"] }
```

---

## ◈ ARCHITECTURE


```mermaid
graph TD
    User([User Application]) --> Core[MkGpu]
    Core --> Backend{MkGpuBackend}
    Backend -->|ash| Vulkan[Vulkan Engine]
    Backend -->|simulation| Dummy[Dummy Engine]
    Vulkan --> Hardware[[Physical GPU]]
```

---

## ◈ LICENSE


Licensed under the **Mozilla Public License 2.0**.

---

<div align="center">

**[ Part of the ◈ MEMKIT ◈ Ecosystem ]**

</div>