Skip to content
This repository has been archived by the owner on Jun 18, 2021. It is now read-only.

Commit

Permalink
Enforce life times of render pass attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
kvark committed Jan 31, 2020
1 parent d512e3c commit db8109f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,9 @@ pub type RenderPassDepthStencilAttachmentDescriptor<'a> =

/// A description of all the attachments of a render pass.
#[derive(Debug)]
pub struct RenderPassDescriptor<'a> {
pub struct RenderPassDescriptor<'a, 'b> {
/// The color attachments of the render pass.
pub color_attachments: &'a [RenderPassColorAttachmentDescriptor<'a>],
pub color_attachments: &'b [RenderPassColorAttachmentDescriptor<'a>],

/// The depth and stencil attachment of the render pass, if any.
pub depth_stencil_attachment:
Expand Down Expand Up @@ -1071,7 +1071,10 @@ impl CommandEncoder {
/// Begins recording of a render pass.
///
/// This function returns a [`RenderPass`] object which records a single render pass.
pub fn begin_render_pass(&mut self, desc: &RenderPassDescriptor) -> RenderPass {
pub fn begin_render_pass<'a>(
&'a mut self,
desc: &RenderPassDescriptor<'a, '_>,
) -> RenderPass<'a> {
let colors = desc
.color_attachments
.iter()
Expand Down

0 comments on commit db8109f

Please sign in to comment.