vyre_driver_wgpu/runtime.rs
1//! Layer 0 GPU runtime: device, buffers, shader compilation, and dispatch.
2
3/// Adapter-caps probe (C-B10).
4///
5/// Projects a `wgpu::Adapter` into the substrate-neutral
6/// [`vyre_foundation::optimizer::AdapterCaps`] passes read to adapt.
7pub mod adapter_caps_probe;
8/// AOT shader specialization cache.
9pub mod aot;
10/// Tiered caching for device buffers and shader pipelines.
11pub mod cache;
12/// GPU device abstraction and initialization.
13pub mod device;
14/// Indirect dispatch path (C-B4).
15///
16/// Submits `ComputePass::dispatch_workgroups_indirect` on a
17/// GPU-resident `[u32; 3]` workgroup-count buffer.
18pub mod indirect;
19/// Pre-recorded persistent dispatch command buffers.
20pub mod prerecorded;
21/// Async readback ring (C-B5).
22///
23/// N-deep staging ring; dispatch i writes to `ring[i % N]`; copies
24/// submit immediately, readbacks map asynchronously. Overlaps
25/// dispatch i+1 with readback i's copy.
26pub mod readback_ring;
27/// Runtime backend auto-picker (C-B11).
28///
29/// Walks `inventory::iter::<BackendRegistration>`, filters by
30/// Program dialect support, picks by precedence. `VYRE_BACKEND=<id>`
31/// forces a specific backend.
32pub mod router;
33/// Runtime wire-format serialization for multi-part programs.
34pub mod serializer;
35/// Shader pipeline compilation and caching.
36pub mod shader;
37/// LRU cache access tracker for buffer eviction policies.
38pub use cache::lru::AccessTracker;
39/// Cache tier policies and access statistics.
40pub use cache::{AccessStats, CacheError, LruPolicy};
41/// Initialize a cached GPU device wrapper.
42pub use device::{cached_adapter_info, cached_device, init_device};
43/// Compile a compute pipeline from WGSL source.
44pub use shader::compile_compute_pipeline::{
45 compile_compute_pipeline, compile_compute_pipeline_with_layout,
46};
47
48/// Build a bind group entry binding `buffer` at `binding` index.
49#[must_use]
50#[inline]
51pub fn bg_entry(binding: u32, buffer: &wgpu::Buffer) -> wgpu::BindGroupEntry<'_> {
52 wgpu::BindGroupEntry {
53 binding,
54 resource: buffer.as_entire_binding(),
55 }
56}