Take old RenderTarget by reference
This commit is contained in:
parent
e4deefae99
commit
d33f89be02
1 changed files with 8 additions and 8 deletions
|
@ -8,19 +8,19 @@ use std::sync::{
|
||||||
pub mod sub_pass;
|
pub mod sub_pass;
|
||||||
use sub_pass::{AttachmentInfo, AttachmentInfoUsage, SubPass};
|
use sub_pass::{AttachmentInfo, AttachmentInfoUsage, SubPass};
|
||||||
|
|
||||||
pub struct RenderTargetBuilder {
|
pub struct RenderTargetBuilder<'a> {
|
||||||
old_render_target: Option<RenderTarget>,
|
old_render_target: Option<&'a RenderTarget>,
|
||||||
sub_passes: Vec<SubPass>,
|
sub_passes: Vec<SubPass>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RenderTargetBuilder {
|
impl<'a> RenderTargetBuilder<'a> {
|
||||||
pub fn add_sub_pass(mut self, sub_pass: SubPass) -> Self {
|
pub fn add_sub_pass(mut self, sub_pass: SubPass) -> Self {
|
||||||
self.sub_passes.push(sub_pass);
|
self.sub_passes.push(sub_pass);
|
||||||
|
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn preserve_old_render_pass(mut self, render_target: RenderTarget) -> Self {
|
pub fn preserve_old_render_pass(mut self, render_target: &'a RenderTarget) -> Self {
|
||||||
self.old_render_target = Some(render_target);
|
self.old_render_target = Some(render_target);
|
||||||
|
|
||||||
self
|
self
|
||||||
|
@ -55,7 +55,7 @@ impl RenderTargetBuilder {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
old_render_target.render_pass
|
old_render_target.render_pass.clone()
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
// gather attachment descriptions
|
// gather attachment descriptions
|
||||||
|
@ -236,9 +236,9 @@ impl RenderTargetBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn map_attachment<'a, F>(&'a self, mut f: F)
|
fn map_attachment<'b, F>(&'b self, mut f: F)
|
||||||
where
|
where
|
||||||
F: FnMut(&'a AttachmentInfo) -> (),
|
F: FnMut(&'b AttachmentInfo) -> (),
|
||||||
{
|
{
|
||||||
for sub_pass in self.sub_passes.iter() {
|
for sub_pass in self.sub_passes.iter() {
|
||||||
for attachment in sub_pass.attachments().iter() {
|
for attachment in sub_pass.attachments().iter() {
|
||||||
|
@ -274,7 +274,7 @@ pub struct RenderTarget {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RenderTarget {
|
impl RenderTarget {
|
||||||
pub fn builder() -> RenderTargetBuilder {
|
pub fn builder<'a>() -> RenderTargetBuilder<'a> {
|
||||||
RenderTargetBuilder {
|
RenderTargetBuilder {
|
||||||
old_render_target: None,
|
old_render_target: None,
|
||||||
sub_passes: Vec::new(),
|
sub_passes: Vec::new(),
|
||||||
|
|
Loading…
Reference in a new issue