Skip to main content

Crate alpha2_gpu

Crate alpha2_gpu 

Source
Expand description

GPU context and capability negotiation: acquiring a GPU device, classifying the adapter (Capabilities), serializing queue access shared with native code (ExternalQueueLock), and collecting the device’s uncaptured errors and losses (GpuDiagnosticLog).

§wgpu interop

The API names no wgpu type by default. The items that hand out or adopt wgpu handles (the device, queue, and adapter, submissions, surfaces) are the interop surface, documented with the wgpu-interop feature, which also re-exports wgpu itself. That surface follows wgpu’s major version. Without the feature those items are hidden: alpha2’s own crates share handles through them, and they are not part of this crate’s API.

Re-exports§

pub use context::ExternalQueueLock;
pub use context::GpuContext;

Structs§

AcquisitionGuard
While alive, keeps every other thread of the process out of the acquisitions that take serialize_acquisition: instance creation, adapter requests and enumeration, and device creation. The thread holding one may take another (an acquisition inside another’s callback).
Capabilities
Adapter facts relevant to rendering decisions.
GpuContext
A GPU device and queue owned by one render host.
GpuDiagnosticLog
The most recent GpuDiagnostics, in arrival order, in fixed memory: at most capacity events, each text at most MAX_DIAGNOSTIC_MESSAGE_BYTES and an ellipsis.
GpuDiagnosticSnapshot
What a GpuDiagnosticLog held when it was read.
GpuError
Failure while acquiring a GPU context: which step failed, and the platform’s reason as its source.

Enums§

CapabilityTier
The capability class exposed to renderer code.
GpuAcquisitionStep
The step of acquiring a GPU context that failed.
GpuDiagnostic
A device-level GPU event that no call return value reports.
GpuErrorKind
What class of error the driver reported.
IntermediateFormat
Internal compositing texture format.

Constants§

MAX_DIAGNOSTIC_MESSAGE_BYTES
Longest message a GpuDiagnosticLog keeps, in bytes. A validation error can quote a whole shader; the log only needs enough to identify it.

Traits§

ExternalQueueLock
Serializes queue access with another API that shares the same queue.

Functions§

serialize_acquisition
Waits until no other thread holds an AcquisitionGuard and returns one.

Type Aliases§

GpuDiagnosticHandler
Shared handler invoked for every GpuDiagnostic.