daedalus-gpu

Crates.iodaedalus-gpu
lib.rsdaedalus-gpu
version0.1.1
created_at2026-01-23 03:16:46.071805+00
updated_at2026-01-23 03:16:46.071805+00
descriptionGPU backends and WGSL dispatch helpers for the Daedalus runtime.
homepagehttps://github.com/Prometheus-Dynamics/Daedalus
repositoryhttps://github.com/Prometheus-Dynamics/Daedalus
max_upload_size
id2063300
size236,894
Mathias (SoZ0)

documentation

https://docs.rs/daedalus-gpu

README

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-wgpu feature). Optional async API (gpu-async).
  • Handles: GpuContextHandle, buffer/image handles, and backend selection with skip reasons.
  • Shader helpers (shader module): 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-friendly GpuBindings, 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, call ctx.dispatch_bindings/dispatch_auto.
  • Readback: use ShaderRunOutput helpers to interpret buffers/textures or get GpuImageHandle.

Testing

  • No-GPU path works everywhere; mock backend available with gpu-mock.
  • GPU tests/examples require --features gpu-wgpu and a compatible device.
Commit count: 8

cargo fmt