<div align="center">
# ◈ MEMKIT GPU ◈
### `[ HARDWARE-AGNOSTIC GPU MEMORY LAYER ]`
[](https://crates.io/crates/memkit-gpu)
[](https://docs.rs/memkit-gpu)
[](../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
| **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
| **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>