mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
[rs] Update wgpu with depth clamping API changes
This commit is contained in:
@@ -28,20 +28,20 @@ cross = ["wgc/cross"]
|
||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.wgc]
|
||||
package = "wgpu-core"
|
||||
git = "https://github.com/gfx-rs/wgpu"
|
||||
rev = "eef478fc5d4de9c114084a4f8a7a3d434697fdba"
|
||||
rev = "e430cf4bcc10aea447f637067fe81c75c80f0e46"
|
||||
features = ["raw-window-handle"]
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dependencies.wgc]
|
||||
package = "wgpu-core"
|
||||
git = "https://github.com/gfx-rs/wgpu"
|
||||
rev = "eef478fc5d4de9c114084a4f8a7a3d434697fdba"
|
||||
rev = "e430cf4bcc10aea447f637067fe81c75c80f0e46"
|
||||
features = ["raw-window-handle"]
|
||||
optional = true
|
||||
|
||||
[dependencies.wgt]
|
||||
package = "wgpu-types"
|
||||
git = "https://github.com/gfx-rs/wgpu"
|
||||
rev = "eef478fc5d4de9c114084a4f8a7a3d434697fdba"
|
||||
rev = "e430cf4bcc10aea447f637067fe81c75c80f0e46"
|
||||
|
||||
[dependencies]
|
||||
arrayvec = "0.5"
|
||||
|
||||
@@ -507,6 +507,7 @@ impl framework::Example for Example {
|
||||
topology: wgpu::PrimitiveTopology::TriangleList,
|
||||
front_face: wgpu::FrontFace::Ccw,
|
||||
cull_mode: Some(wgpu::Face::Back),
|
||||
clamp_depth: device.features().contains(wgpu::Features::DEPTH_CLAMPING),
|
||||
..Default::default()
|
||||
},
|
||||
depth_stencil: Some(wgpu::DepthStencilState {
|
||||
@@ -519,7 +520,6 @@ impl framework::Example for Example {
|
||||
slope_scale: 2.0,
|
||||
clamp: 0.0,
|
||||
},
|
||||
clamp_depth: device.features().contains(wgpu::Features::DEPTH_CLAMPING),
|
||||
}),
|
||||
multisample: wgpu::MultisampleState::default(),
|
||||
});
|
||||
@@ -646,7 +646,6 @@ impl framework::Example for Example {
|
||||
depth_compare: wgpu::CompareFunction::Less,
|
||||
stencil: wgpu::StencilState::default(),
|
||||
bias: wgpu::DepthBiasState::default(),
|
||||
clamp_depth: false,
|
||||
}),
|
||||
multisample: wgpu::MultisampleState::default(),
|
||||
});
|
||||
|
||||
@@ -232,7 +232,6 @@ impl framework::Example for Skybox {
|
||||
depth_compare: wgpu::CompareFunction::LessEqual,
|
||||
stencil: wgpu::StencilState::default(),
|
||||
bias: wgpu::DepthBiasState::default(),
|
||||
clamp_depth: false,
|
||||
}),
|
||||
multisample: wgpu::MultisampleState::default(),
|
||||
});
|
||||
@@ -263,7 +262,6 @@ impl framework::Example for Skybox {
|
||||
depth_compare: wgpu::CompareFunction::LessEqual,
|
||||
stencil: wgpu::StencilState::default(),
|
||||
bias: wgpu::DepthBiasState::default(),
|
||||
clamp_depth: false,
|
||||
}),
|
||||
multisample: wgpu::MultisampleState::default(),
|
||||
});
|
||||
|
||||
@@ -570,7 +570,6 @@ impl framework::Example for Example {
|
||||
depth_compare: wgpu::CompareFunction::Less,
|
||||
stencil: wgpu::StencilState::default(),
|
||||
bias: wgpu::DepthBiasState::default(),
|
||||
clamp_depth: false,
|
||||
}),
|
||||
// No multisampling is used.
|
||||
multisample: wgpu::MultisampleState::default(),
|
||||
@@ -605,7 +604,6 @@ impl framework::Example for Example {
|
||||
depth_compare: wgpu::CompareFunction::Less,
|
||||
stencil: wgpu::StencilState::default(),
|
||||
bias: wgpu::DepthBiasState::default(),
|
||||
clamp_depth: false,
|
||||
}),
|
||||
multisample: wgpu::MultisampleState::default(),
|
||||
});
|
||||
|
||||
@@ -603,6 +603,8 @@ fn map_primitive_state(primitive: &wgt::PrimitiveState) -> web_sys::GpuPrimitive
|
||||
PrimitiveTopology::TriangleStrip => pt::TriangleStrip,
|
||||
});
|
||||
|
||||
//mapped.clamp_depth(primitive.clamp_depth);
|
||||
|
||||
mapped
|
||||
}
|
||||
|
||||
@@ -647,7 +649,6 @@ fn map_stencil_state_face(desc: &wgt::StencilFaceState) -> web_sys::GpuStencilFa
|
||||
|
||||
fn map_depth_stencil_state(desc: &wgt::DepthStencilState) -> web_sys::GpuDepthStencilState {
|
||||
let mut mapped = web_sys::GpuDepthStencilState::new(map_texture_format(desc.format));
|
||||
mapped.clamp_depth(desc.clamp_depth);
|
||||
mapped.depth_bias(desc.bias.constant);
|
||||
mapped.depth_bias_clamp(desc.bias.clamp);
|
||||
mapped.depth_bias_slope_scale(desc.bias.slope_scale);
|
||||
|
||||
Reference in New Issue
Block a user