alpha2_gpu/lib.rs
1//! GPU context and capability negotiation: acquiring a GPU device, classifying
2//! the adapter ([`Capabilities`]), serializing queue access shared with native
3//! code ([`ExternalQueueLock`]), and collecting the device's uncaptured errors
4//! and losses ([`GpuDiagnosticLog`]).
5//!
6//! # `wgpu` interop
7//!
8//! The API names no `wgpu` type by default. The items that hand out or adopt
9//! `wgpu` handles (the device, queue, and adapter, submissions, surfaces) are
10//! the interop surface, documented with the `wgpu-interop` feature, which also
11//! re-exports `wgpu` itself. That surface follows `wgpu`'s major version.
12//! Without the feature those items are hidden: alpha2's own crates share
13//! handles through them, and they are not part of this crate's API.
14
15mod acquisition;
16mod capabilities;
17mod context;
18mod diagnostic;
19mod error;
20
21pub use acquisition::{AcquisitionGuard, serialize_acquisition};
22pub use capabilities::{Capabilities, CapabilityTier, IntermediateFormat};
23pub use context::{AcceptedDevice, AdapterRefusals, ExternalQueueLock, GpuContext, SubmitTimings};
24pub use diagnostic::{
25 GpuDiagnostic, GpuDiagnosticHandler, GpuDiagnosticLog, GpuDiagnosticSnapshot, GpuErrorKind,
26 MAX_DIAGNOSTIC_MESSAGE_BYTES,
27};
28pub use error::{GpuAcquisitionStep, GpuError};
29/// The `wgpu` this crate is built on, with the `wgpu-interop` feature. Every
30/// `wgpu` type the interop surface takes or returns, here and in the crates
31/// built on this one, is this crate's, so a caller names them through this
32/// path instead of depending on a `wgpu` version of their own. When this
33/// crate moves to a new `wgpu` major, the types behind this path change with
34/// it, and so does the interop surface.
35#[cfg(feature = "wgpu-interop")]
36pub use wgpu;