Skip to content

Commit d67fe98

Browse files
committed
[add] BeginRenderPassTo for choosing a render destination.
1 parent 547d7da commit d67fe98

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

crates/lambda-rs/src/render/command.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ impl IndexFormat {
3030
}
3131
}
3232

33+
/// Render destination selected when beginning a render pass.
34+
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
35+
pub enum RenderDestination {
36+
/// Target the presentation surface.
37+
Surface,
38+
/// Target a previously attached offscreen destination by id.
39+
Offscreen(super::ResourceId),
40+
}
41+
3342
/// Commands recorded and executed by the `RenderContext` to produce a frame.
3443
///
3544
/// Order and validity are enforced by the encoder where possible. Invalid
@@ -56,6 +65,15 @@ pub enum RenderCommand {
5665
render_pass: super::ResourceId,
5766
viewport: Viewport,
5867
},
68+
/// Begin a render pass targeting an explicit destination.
69+
///
70+
/// `BeginRenderPass` remains valid and is equivalent to beginning a pass
71+
/// with `RenderDestination::Surface`.
72+
BeginRenderPassTo {
73+
render_pass: super::ResourceId,
74+
viewport: Viewport,
75+
destination: RenderDestination,
76+
},
5977
/// End the current render pass.
6078
EndRenderPass,
6179

0 commit comments

Comments
 (0)