agpu
Standalone agentic-first GPU rendering backend — a complete wgpu replacement with built-in ontology for AI agent discoverability.
Features
- Vulkan-first with automatic fallback to OpenGL/GLES and platform defaults
- Complete ontology — every GPU resource, pipeline, and UI element is discoverable by AI agents
- Elm architecture runtime (
Model/update/view) with async commands and cancellation - Painter trait — backend-agnostic 2D drawing (shapes, text, clipping)
- GPU text via glyphon (harfbuzz shaping, subpixel positioning)
- Batched shape renderer — circles, rounded rects, lines in a single draw call
- Zero
unsafein application code - No external GUI framework dependency — fully self-contained
Architecture
┌─────────────────────────────────────────────────┐
│ AgpuApp<M: Model> │
│ ├── GpuContext (instance/adapter/device/queue) │
│ ├── ShapeRenderer (batched 2D geometry) │
│ ├── TextEngine (glyphon GPU text) │
│ ├── AgpuPainter (Painter trait impl) │
│ └── OntologyRegistry (agent discoverability) │
└─────────────────────────────────────────────────┘
Quick Start
use *;
Backend Selection
use ;
// Vulkan (default)
new.run;
// Prefer OpenGL / GLES
new
.with_backend
.run;
// Platform default (D3D12 on Windows, Metal on macOS, Vulkan on Linux)
new
.with_backend
.run;
Ontology
Every GPU resource implements the Discoverable trait, exposing:
| Method | Description |
|---|---|
schema() |
JSON-serializable widget/resource schema |
capabilities() |
Advertised capabilities (Focusable, Scrollable, …) |
actions() |
Available agent actions with typed parameters |
semantic_role() |
ARIA-like semantic role (Button, TextInput, …) |
agent_state() |
Live key-value state snapshot |
execute_action() |
Programmatic action execution |
The OntologyRegistry aggregates all schemas and maintains a live UiTree for frame-by-frame agent inspection.
License
AGPL-3.0-or-later