Skip to content

Commit 49b773f

Browse files
cwfitzgeraldErichDonGubler
authored andcommitted
Add some documentation to wgpu-hal types
1 parent 1ed6187 commit 49b773f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

wgpu-hal/src/lib.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,13 @@ impl InstanceError {
472472
}
473473
}
474474

475+
/// All the types and methods that make up a implementation on top of a backend.
476+
///
477+
/// Only the types that have non-dyn trait bounds have methods on them. Most methods
478+
/// are either on [`CommandEncoder`] or [`Device`].
479+
///
480+
/// The api can either be used through generics (through use of this trait and associated
481+
/// types) or dynamically through using the `Dyn*` traits.
475482
pub trait Api: Clone + fmt::Debug + Sized + WasmNotSendSync + 'static {
476483
const VARIANT: wgt::Backend;
477484

@@ -1806,6 +1813,10 @@ pub struct Capabilities {
18061813
pub downlevel: wgt::DownlevelCapabilities,
18071814
}
18081815

1816+
/// An adapter with all the information needed to reason about its capabilities.
1817+
///
1818+
/// These are either made by [`Instance::enumerate_adapters`] or by backend specific
1819+
/// methods on the backend [`Instance`] or [`Adapter`].
18091820
#[derive(Debug)]
18101821
pub struct ExposedAdapter<A: Api> {
18111822
pub adapter: A::Adapter,
@@ -1860,6 +1871,10 @@ pub struct AcquiredSurfaceTexture<A: Api> {
18601871
pub suboptimal: bool,
18611872
}
18621873

1874+
/// An open connection to a device and a queue.
1875+
///
1876+
/// This can be created from [`Adapter::open`] or backend
1877+
/// specific methods on the backend's [`Instance`] or [`Adapter`].
18631878
#[derive(Debug)]
18641879
pub struct OpenDevice<A: Api> {
18651880
pub device: A::Device,

0 commit comments

Comments
 (0)