1 unstable release
Uses new Rust 2024
| 0.1.1 | Jan 23, 2026 |
|---|
#291 in Graphics APIs
Used in 5 crates
195KB
5K
SLoC
daedalus-gpu
Lightweight GPU facade and shader helpers built on wgpu. Provides opaque handles, pooling, and dispatch utilities so GPU-capable nodes can run without exposing backend types.
What it offers
- Backends: noop (default), mock (tests), real wgpu (
gpu-wgpufeature). Optional async API (gpu-async). - Handles:
GpuContextHandle, buffer/image handles, and backend selection with skip reasons. - Shader helpers (
shadermodule): derive-friendly WGSL binding inference, storage/texture helpers, workgroup derivation, readback paths, pooling, and caching. - Pooling/caching: LRU-bounded pipeline/bind-group caches and temp buffer/texture pools.
Feature flags
gpu-wgpu: enable the real wgpu backend and shader module.gpu-mock: deterministic mock backend.gpu-noop: always-available fallback (default).gpu-async: async dispatch/readback APIs.
Key modules
shader: WGSL dispatch helpers, derive-friendlyGpuBindings,GpuState, readback, and caching.wgpu_backend: actual wgpu device/queue management (feature-gated).convert: payload helpers for CPU↔GPU images/buffers.handles: opaque buffer/image IDs and allocation helpers.
Typical use
- Select a backend:
GpuContextHandle::select_backend. - Derive bindings: annotate a struct with
#[derive(GpuBindings)]and#[gpu(spec(...))]. - Dispatch: create
ShaderContext, callctx.dispatch_bindings/dispatch_auto. - Readback: use
ShaderRunOutputhelpers to interpret buffers/textures or getGpuImageHandle.
Testing
- No-GPU path works everywhere; mock backend available with
gpu-mock. - GPU tests/examples require
--features gpu-wgpuand a compatible device.
Dependencies
~8–39MB
~580K SLoC