Skip to content

Commit

Permalink
https://github.com/gfx-rs/wgpu/pull/3610
Browse files Browse the repository at this point in the history
  • Loading branch information
tychedelia committed Oct 8, 2023
1 parent 2c456d0 commit 2595135
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 7 additions & 6 deletions nannou_wgpu/src/render_pipeline_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub struct RenderPipelineBuilder<'a> {
fs_entry_point: &'a str,
primitive: wgpu::PrimitiveState,
color_state: Option<wgpu::ColorTargetState>,
color_states: &'a [wgpu::ColorTargetState],
color_states: &'a [Option<wgpu::ColorTargetState>],
depth_stencil: Option<wgpu::DepthStencilState>,
vertex_buffers: Vec<wgpu::VertexBufferLayout<'static>>,
multisample: wgpu::MultisampleState,
Expand Down Expand Up @@ -387,9 +387,9 @@ impl<'a> RenderPipelineBuilder<'a> {

/// If enabled polygon depth is clamped to 0-1 range instead of being clipped.
///
/// Requires `Features::DEPTH_CLAMPING` enabled.
pub fn clamp_depth(mut self, b: bool) -> Self {
self.primitive.clamp_depth = b;
/// Requires `Features::DEPTH_CLIP_CONTROL` enabled.
pub fn unclipped_depth(mut self, b: bool) -> Self {
self.primitive.unclipped_depth = b;
self
}

Expand Down Expand Up @@ -527,10 +527,10 @@ fn build(
buffers: &vertex_buffers[..],
};

let mut single_color_state = [RenderPipelineBuilder::DEFAULT_COLOR_STATE];
let mut single_color_state = [Some(RenderPipelineBuilder::DEFAULT_COLOR_STATE)];
let color_states = match (fs_mod.is_some(), color_states.is_empty()) {
(true, true) => {
if let Some(cs) = color_state {
if let cs @ Some(_) = color_state {
single_color_state[0] = cs;
}
&single_color_state[..]
Expand Down Expand Up @@ -559,6 +559,7 @@ fn build(
depth_stencil,
multisample,
fragment,
multiview: todo!(),
};

device.create_render_pipeline(&pipeline_desc)
Expand Down
4 changes: 2 additions & 2 deletions nannou_wgpu/src/sampler_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl<'b> SamplerBuilder {
pub const DEFAULT_LOD_MIN_CLAMP: f32 = -100.0;
pub const DEFAULT_LOD_MAX_CLAMP: f32 = 100.0;
pub const DEFAULT_COMPARE: Option<wgpu::CompareFunction> = None;
pub const DEFAULT_ANISOTROPY_CLAMP: Option<NonZeroU8> = None;
pub const DEFAULT_ANISOTROPY_CLAMP: u16 = 1;
pub const DEFAULT_LABEL: &'static str = "nannou-sampler";
pub const DEFAULT_BORDER_COLOR: Option<wgpu::SamplerBorderColor> = None;
pub const DEFAULT_DESCRIPTOR: wgpu::SamplerDescriptor<'static> = wgpu::SamplerDescriptor {
Expand Down Expand Up @@ -111,7 +111,7 @@ impl<'b> SamplerBuilder {
}

/// The anisotropy level to clamp to, if any.
pub fn anisotropy_clamp(mut self, clamp: Option<NonZeroU8>) -> Self {
pub fn anisotropy_clamp(mut self, clamp: u16) -> Self {
self.descriptor.anisotropy_clamp = clamp;
self
}
Expand Down

0 comments on commit 2595135

Please sign in to comment.