Skip to content

Commit a8fc4a3

Browse files
bors[bot]kvark
andauthored
[rs] Merge gfx-rs#845
845: Update wgpu with depth clamping API changes r=kvark a=kvark Picks up gfx-rs#1309 Co-authored-by: Dzmitry Malyshau <[email protected]>
2 parents 2448307 + 756ea0e commit a8fc4a3

File tree

5 files changed

+6
-10
lines changed

5 files changed

+6
-10
lines changed

wgpu/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,20 @@ cross = ["wgc/cross"]
2828
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.wgc]
2929
package = "wgpu-core"
3030
git = "https://github.com/gfx-rs/wgpu"
31-
rev = "eef478fc5d4de9c114084a4f8a7a3d434697fdba"
31+
rev = "e430cf4bcc10aea447f637067fe81c75c80f0e46"
3232
features = ["raw-window-handle"]
3333

3434
[target.'cfg(target_arch = "wasm32")'.dependencies.wgc]
3535
package = "wgpu-core"
3636
git = "https://github.com/gfx-rs/wgpu"
37-
rev = "eef478fc5d4de9c114084a4f8a7a3d434697fdba"
37+
rev = "e430cf4bcc10aea447f637067fe81c75c80f0e46"
3838
features = ["raw-window-handle"]
3939
optional = true
4040

4141
[dependencies.wgt]
4242
package = "wgpu-types"
4343
git = "https://github.com/gfx-rs/wgpu"
44-
rev = "eef478fc5d4de9c114084a4f8a7a3d434697fdba"
44+
rev = "e430cf4bcc10aea447f637067fe81c75c80f0e46"
4545

4646
[dependencies]
4747
arrayvec = "0.5"

wgpu/examples/shadow/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ impl framework::Example for Example {
507507
topology: wgpu::PrimitiveTopology::TriangleList,
508508
front_face: wgpu::FrontFace::Ccw,
509509
cull_mode: Some(wgpu::Face::Back),
510+
clamp_depth: device.features().contains(wgpu::Features::DEPTH_CLAMPING),
510511
..Default::default()
511512
},
512513
depth_stencil: Some(wgpu::DepthStencilState {
@@ -519,7 +520,6 @@ impl framework::Example for Example {
519520
slope_scale: 2.0,
520521
clamp: 0.0,
521522
},
522-
clamp_depth: device.features().contains(wgpu::Features::DEPTH_CLAMPING),
523523
}),
524524
multisample: wgpu::MultisampleState::default(),
525525
});
@@ -646,7 +646,6 @@ impl framework::Example for Example {
646646
depth_compare: wgpu::CompareFunction::Less,
647647
stencil: wgpu::StencilState::default(),
648648
bias: wgpu::DepthBiasState::default(),
649-
clamp_depth: false,
650649
}),
651650
multisample: wgpu::MultisampleState::default(),
652651
});

wgpu/examples/skybox/main.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ impl framework::Example for Skybox {
232232
depth_compare: wgpu::CompareFunction::LessEqual,
233233
stencil: wgpu::StencilState::default(),
234234
bias: wgpu::DepthBiasState::default(),
235-
clamp_depth: false,
236235
}),
237236
multisample: wgpu::MultisampleState::default(),
238237
});
@@ -263,7 +262,6 @@ impl framework::Example for Skybox {
263262
depth_compare: wgpu::CompareFunction::LessEqual,
264263
stencil: wgpu::StencilState::default(),
265264
bias: wgpu::DepthBiasState::default(),
266-
clamp_depth: false,
267265
}),
268266
multisample: wgpu::MultisampleState::default(),
269267
});

wgpu/examples/water/main.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,6 @@ impl framework::Example for Example {
570570
depth_compare: wgpu::CompareFunction::Less,
571571
stencil: wgpu::StencilState::default(),
572572
bias: wgpu::DepthBiasState::default(),
573-
clamp_depth: false,
574573
}),
575574
// No multisampling is used.
576575
multisample: wgpu::MultisampleState::default(),
@@ -605,7 +604,6 @@ impl framework::Example for Example {
605604
depth_compare: wgpu::CompareFunction::Less,
606605
stencil: wgpu::StencilState::default(),
607606
bias: wgpu::DepthBiasState::default(),
608-
clamp_depth: false,
609607
}),
610608
multisample: wgpu::MultisampleState::default(),
611609
});

wgpu/src/backend/web.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,8 @@ fn map_primitive_state(primitive: &wgt::PrimitiveState) -> web_sys::GpuPrimitive
603603
PrimitiveTopology::TriangleStrip => pt::TriangleStrip,
604604
});
605605

606+
//mapped.clamp_depth(primitive.clamp_depth);
607+
606608
mapped
607609
}
608610

@@ -647,7 +649,6 @@ fn map_stencil_state_face(desc: &wgt::StencilFaceState) -> web_sys::GpuStencilFa
647649

648650
fn map_depth_stencil_state(desc: &wgt::DepthStencilState) -> web_sys::GpuDepthStencilState {
649651
let mut mapped = web_sys::GpuDepthStencilState::new(map_texture_format(desc.format));
650-
mapped.clamp_depth(desc.clamp_depth);
651652
mapped.depth_bias(desc.bias.constant);
652653
mapped.depth_bias_clamp(desc.bias.clamp);
653654
mapped.depth_bias_slope_scale(desc.bias.slope_scale);

0 commit comments

Comments
 (0)