Skip to main content

Crate rightkit_gpu

Crate rightkit_gpu 

Source
Expand description

Shared wgpu device context for Right Suite apps (#1159): per-OS backend policy, a crash sentinel around device creation, adapter pick and limits, an exit gate for in-flight GPU work, and a device-memory budget that adapts to out-of-memory. Native only; the apps’ kernels stay in the apps.

wgpu is pinned at 30 here (the version Ember builds on, and rightkit-compositor’s). CutRight moves from 29.0.1 to 30 to use this crate; the crate does not carry both.

Adapted from Ember crates/gpu (backend.rs, exit.rs, budget.rs, the generic part of ctx.rs); see NOTICE.

Re-exports§

pub use wgpu;

Modules§

backend
Which wgpu backends an app lets wgpu use, for its compute device and for its window, and the crash sentinel around device creation (issue #136). Adapted from Ember crates/gpu.
exit
Leaving: no GPU work may be in flight when the process ends (issue #620). Adapted from Ember crates/gpu.

Structs§

ContextOptions
How the app wants the device made.
GpuContext
A wgpu device and queue on a chosen adapter.
LimitsCap
An upper bound on the device’s limits.
MemoryBudget
Permit
Room on the device for one render, released when dropped.

Functions§

adapter_names
The names of the usable adapters for backends. Loads the drivers; the device is not created.
footprint
Device memory a render is expected to hold: the source, two working copies and the output, as float RGBA, at the source’s size.
initial
Where the budget starts: 1.5 × the largest buffer the device allows (about the device’s memory on small cards), at least 1 GiB.
parse_limits_cap
Parses a limits cap the way Ember’s LIGHTCRAFT_GPU_LIMITS does: webgpu / downlevel / default = the WebGPU defaults (128 MiB storage bindings, 256 MiB buffers), <n> (or <n>MiB, <n>MB) = n MiB storage bindings and 2n MiB buffers. Empty or unparsable: None.
pick_adapter
The index of the adapter called wanted in names (the first with that name), or None when there is none, so the default choice is used.