Skip to content

Commit

Permalink
https://github.com/gfx-rs/wgpu/pull/2171
Browse files Browse the repository at this point in the history
  • Loading branch information
tychedelia committed Oct 8, 2023
1 parent 67c531f commit 2c456d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions nannou_wgpu/src/render_pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::{self as wgpu, Color, LoadOp};
/// A builder type to simplify the process of creating a render pass descriptor.
#[derive(Debug, Default)]
pub struct Builder<'a> {
color_attachments: Vec<wgpu::RenderPassColorAttachment<'a>>,
color_attachments: Vec<Option<wgpu::RenderPassColorAttachment<'a>>>,
depth_stencil_attachment: Option<wgpu::RenderPassDepthStencilAttachment<'a>>,
}

Expand Down Expand Up @@ -168,7 +168,7 @@ impl<'a> Builder<'a> {
{
let builder = ColorAttachmentDescriptorBuilder::new(attachment);
let descriptor = color_builder(builder).descriptor;
self.color_attachments.push(descriptor);
self.color_attachments.push(Some(descriptor));
self
}

Expand Down Expand Up @@ -196,7 +196,7 @@ impl<'a> Builder<'a> {
pub fn into_inner(
self,
) -> (
Vec<wgpu::RenderPassColorAttachment<'a>>,
Vec<Option<wgpu::RenderPassColorAttachment<'a>>>,
Option<wgpu::RenderPassDepthStencilAttachment<'a>>,
) {
let Builder {
Expand All @@ -211,7 +211,7 @@ impl<'a> Builder<'a> {
let (color_attachments, depth_stencil_attachment) = self.into_inner();
let descriptor = wgpu::RenderPassDescriptor {
label: Some("nannou_render_pass"),
color_attachments: &color_attachments.into_iter().map(|x| Some(x)).collect(),
color_attachments: &color_attachments,
depth_stencil_attachment,
};
encoder.begin_render_pass(&descriptor)
Expand Down
4 changes: 2 additions & 2 deletions nannou_wgpu/src/render_pipeline_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl<'a> RenderPipelineBuilder<'a> {
front_face: Self::DEFAULT_FRONT_FACE,
cull_mode: Self::DEFAULT_CULL_MODE,
polygon_mode: Self::DEFAULT_POLYGON_MODE,
clamp_depth: Self::DEFAULT_CLAMP_DEPTH,
unclipped_depth: Self::DEFAULT_UNCLIPPED_DEPTH,
conservative: false,
};

Expand Down Expand Up @@ -101,7 +101,7 @@ impl<'a> RenderPipelineBuilder<'a> {
slope_scale: Self::DEFAULT_DEPTH_BIAS_SLOPE_SCALE,
clamp: Self::DEFAULT_DEPTH_BIAS_CLAMP,
};
pub const DEFAULT_CLAMP_DEPTH: bool = false;
pub const DEFAULT_UNCLIPPED_DEPTH: bool = false;
pub const DEFAULT_DEPTH_STENCIL: wgpu::DepthStencilState = wgpu::DepthStencilState {
format: Self::DEFAULT_DEPTH_FORMAT,
depth_write_enabled: Self::DEFAULT_DEPTH_WRITE_ENABLED,
Expand Down

0 comments on commit 2c456d0

Please sign in to comment.