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§
- Acquisition
Guard - 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.
- GpuDiagnostic
Log - The most recent
GpuDiagnostics, in arrival order, in fixed memory: at mostcapacityevents, each text at mostMAX_DIAGNOSTIC_MESSAGE_BYTESand an ellipsis. - GpuDiagnostic
Snapshot - What a
GpuDiagnosticLogheld when it was read. - GpuError
- Failure while acquiring a GPU context: which step failed, and the
platform’s reason as its
source.
Enums§
- Capability
Tier - The capability class exposed to renderer code.
- GpuAcquisition
Step - The step of acquiring a GPU context that failed.
- GpuDiagnostic
- A device-level GPU event that no call return value reports.
- GpuError
Kind - What class of error the driver reported.
- Intermediate
Format - Internal compositing texture format.
Constants§
- MAX_
DIAGNOSTIC_ MESSAGE_ BYTES - Longest message a
GpuDiagnosticLogkeeps, in bytes. A validation error can quote a whole shader; the log only needs enough to identify it.
Traits§
- External
Queue Lock - Serializes queue access with another API that shares the same queue.
Functions§
- serialize_
acquisition - Waits until no other thread holds an
AcquisitionGuardand returns one.
Type Aliases§
- GpuDiagnostic
Handler - Shared handler invoked for every
GpuDiagnostic.