pub trait GpuContext: Send + Sync {
// Required methods
fn backend(&self) -> GpuBackendKind;
fn adapter_info(&self) -> GpuAdapterInfo;
fn capabilities(&self) -> GpuCapabilities;
// Provided methods
fn stats(&self) -> TransferStats { ... }
fn take_stats(&self) -> TransferStats { ... }
fn record_download(&self, _bytes: u64) { ... }
}Expand description
Optional context trait if backends need per-thread context.
use daedalus_gpu::{GpuContext, GpuBackendKind};
fn kind(ctx: &dyn GpuContext) -> GpuBackendKind {
ctx.backend()
}
let _ = kind;