Skip to main content

alpha2_gpu/
lib.rs

1//! GPU device acquisition, adapter classification ([`Capabilities`]), queue access shared with
2//! native code ([`ExternalQueueLock`]), and collection of uncaptured errors and device losses
3//! ([`GpuDiagnosticLog`]).
4//!
5//! # `wgpu` interop
6//!
7//! The default API names no `wgpu` type. Items that hand out or adopt `wgpu` handles are
8//! documented only with the `wgpu-interop` feature, which also re-exports `wgpu` and follows its
9//! major version. Without the feature they are hidden and not part of the public API.
10
11mod acquisition;
12mod adapter_choice;
13mod adapter_pin;
14mod capabilities;
15mod context;
16mod diagnostic;
17mod error;
18mod instance;
19mod rate;
20pub mod validation_log;
21mod watchdog;
22
23pub use acquisition::{AcquisitionGuard, serialize_acquisition};
24pub use adapter_choice::{
25    AdapterChoiceReport, AdapterOrder, AdapterRecord, ChoiceReason, GPU_ENCODE_CODECS,
26    decode_refusals, encode_elsewhere, explain_choice, rank_adapters,
27};
28pub use adapter_pin::{AdapterPolicy, gl_version_supported, high_performance_rank, product_order};
29pub use capabilities::{
30    Capabilities, CapabilityTier, IntermediateFormat, software_adapter, software_renderer_name,
31};
32pub use context::{
33    AcceptedDevice, AdapterRefusals, ExternalQueueLock, GpuContext, ProductRequest,
34    SoftwareAdapters, SubmitTimings, product_backends,
35};
36pub use diagnostic::{
37    GpuDiagnostic, GpuDiagnosticHandler, GpuDiagnosticLog, GpuDiagnosticSnapshot, GpuErrorKind,
38    MAX_DIAGNOSTIC_MESSAGE_BYTES,
39};
40pub use error::{GpuAcquisitionStep, GpuError};
41pub use instance::{
42    Dx12Compiler, InstanceSettings, InstanceSettingsError, ShaderCompiler, configure_instances,
43    dx12_shader_compiler, instance_descriptor, instance_settings, new_instance, shader_compiler_of,
44};
45pub use rate::{GpuRate, UNCALIBRATED_MS_PER_UNIT_PIXEL};
46pub use watchdog::{
47    WATCHDOG_MS, hung_threshold_ms, set_watchdog_ms, submission_budget_ms, watchdog_ms,
48};
49/// The `wgpu` this crate is built on. Interop callers should name `wgpu` types through this path
50/// rather than depend on their own `wgpu` version.
51#[cfg(feature = "wgpu-interop")]
52pub use wgpu;