Skip to main content

Module buffer

Module buffer 

Source
Expand description

Buffer arena for the wgpu backend. Mirrors the rlx-metal arena shape: pre-plan one big storage buffer at compile time, sub-allocate per-node offsets at known positions, treat I/O as write_buffer / read_buffer against those offsets.

wgpu’s storage buffers are fine for both reads and writes from compute shaders; there’s no shared-memory requirement at the API level (unlike Metal where StorageModeShared matters). On Apple Silicon wgpu’s Metal backend gives us unified memory automatically.

Structs§

Arena
One contiguous arena buffer + per-node byte offsets. Lives for the entire executable graph’s lifetime.

Functions§

plan_f32_uniform
Plan memory using f32-sized slots regardless of declared IR dtype, with liveness-aware slot reuse (see rlx_compile::memory::plan_memory_f32_uniform).