Skip to content

Commit d27f5a5

Browse files
committed
[add] documentation for gfx fences.
1 parent d1d2962 commit d27f5a5

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

crates/lambda-platform/src/gfx/fence.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
//! GPU fence & semaphore implementations for rendering synchronizations. These
2+
//! implementations built on top of gfx-hal and are used by the lambda-platform
3+
//! rendering implementations to synchronize GPU operations.
4+
15
use gfx_hal::device::Device;
26

37
pub struct RenderSemaphoreBuilder {}
@@ -7,6 +11,8 @@ impl RenderSemaphoreBuilder {
711
return Self {};
812
}
913

14+
/// Builds a new render semaphore using the provided GPU. This semaphore can
15+
/// only be used with the GPU that it was created with.
1016
pub fn build<RenderBackend: gfx_hal::Backend>(
1117
self,
1218
gpu: &mut super::gpu::Gpu<RenderBackend>,
@@ -18,6 +24,7 @@ impl RenderSemaphoreBuilder {
1824
return RenderSemaphore { semaphore };
1925
}
2026
}
27+
2128
pub struct RenderSemaphore<RenderBackend: gfx_hal::Backend> {
2229
semaphore: RenderBackend::Semaphore,
2330
}
@@ -36,6 +43,8 @@ pub struct RenderSubmissionFenceBuilder {
3643
}
3744

3845
impl RenderSubmissionFenceBuilder {
46+
/// Creates a new Render Submission Fence Builder that defaults to a 1 second
47+
/// timeout for waiting on the fence.
3948
pub fn new() -> Self {
4049
return Self {
4150
default_render_timeout: 1_000_000_000,
@@ -49,6 +58,8 @@ impl RenderSubmissionFenceBuilder {
4958
return self;
5059
}
5160

61+
/// Builds a new submission fence using the provided GPU. This fence can only
62+
/// be used to block operation on the GPU that created it.
5263
pub fn build<RenderBackend: gfx_hal::Backend>(
5364
self,
5465
gpu: &mut super::gpu::Gpu<RenderBackend>,

0 commit comments

Comments
 (0)