# vyre-wgpu
wgpu backend for vyre IR — implements `vyre::VyreBackend` on any wgpu-capable GPU (Vulkan, DX12, Metal, WebGPU).
```
cargo add vyre vyre-wgpu
```
## Example
```rust
use vyre::ir::Program;
use vyre::{DispatchConfig, VyreBackend};
use vyre_wgpu::WgpuBackend;
let backend = WgpuBackend::acquire().await?;
let program: Program = my_program();
let inputs: &[&[u8]] = &[b"input data"];
let config = DispatchConfig::default();
let outputs: Vec<Vec<u8>> = backend.dispatch(&program, inputs, &config)?;
```
## Features
- Pipeline cache — reuses compiled WGSL pipelines across dispatches by content hash.
- Buffer pool — reuses GPU buffer allocations across dispatches.
- Tiered validation cache — three-level cache for repeated shader validation.
- Lowering happens internally. Consumers never pass WGSL strings; the crate lowers `Program` to WGSL via `vyre::lower::wgsl::emit`.
## Requirements
- A wgpu-capable GPU. This crate does NOT silently fall back to CPU. Absence of a GPU is surfaced as an error, not a degradation.
- `wgpu = 24.x`. Pinned — major wgpu version bumps are a vyre-wgpu major bump.
## MSRV
Rust 1.85.
## License
MIT OR Apache-2.0.