Update wgpu, use defaults for rasterizer states, use depth-clamping

This commit is contained in:
Dzmitry Malyshau committed 2020-07-23 22:35:13 -04:00
1 parent 25b5fb01dc
commit b76e560432
11 files changed
+21 -34

No files matched your search

+1
View File
@@ -33,6 +33,7 @@ All framework-based examples render to the window.
| optional extensions | | | | | | | :star: | |
| - binding indexing | | | | | | | :star: | |
| - push constants | | | | | | | :star: | |
| - depth clamping | | | | | :star | | | |
| WGSL shaders | | | | | | | | |
## Hacking
+1 -3
View File
@@ -116,9 +116,7 @@ impl framework::Example for Example {
rasterization_state: Some(wgpu::RasterizationStateDescriptor {
front_face: wgpu::FrontFace::Ccw,
cull_mode: wgpu::CullMode::None,
depth_bias: 0,
depth_bias_slope_scale: 0.0,
depth_bias_clamp: 0.0,
..Default::default()
}),
primitive_topology: wgpu::PrimitiveTopology::TriangleList,
color_states: Borrowed(&[wgpu::ColorStateDescriptor {
+1 -3
View File
@@ -252,9 +252,7 @@ impl framework::Example for Example {
rasterization_state: Some(wgpu::RasterizationStateDescriptor {
front_face: wgpu::FrontFace::Ccw,
cull_mode: wgpu::CullMode::Back,
depth_bias: 0,
depth_bias_slope_scale: 0.0,
depth_bias_clamp: 0.0,
..Default::default()
}),
primitive_topology: wgpu::PrimitiveTopology::TriangleList,
color_states: Borrowed(&[wgpu::ColorStateDescriptor {
+2 -6
View File
@@ -121,9 +121,7 @@ impl Example {
rasterization_state: Some(wgpu::RasterizationStateDescriptor {
front_face: wgpu::FrontFace::Ccw,
cull_mode: wgpu::CullMode::None,
depth_bias: 0,
depth_bias_slope_scale: 0.0,
depth_bias_clamp: 0.0,
..Default::default()
}),
primitive_topology: wgpu::PrimitiveTopology::TriangleStrip,
color_states: Borrowed(&[wgpu::ColorStateDescriptor {
@@ -351,9 +349,7 @@ impl framework::Example for Example {
rasterization_state: Some(wgpu::RasterizationStateDescriptor {
front_face: wgpu::FrontFace::Ccw,
cull_mode: wgpu::CullMode::Back,
depth_bias: 0,
depth_bias_slope_scale: 0.0,
depth_bias_clamp: 0.0,
..Default::default()
}),
primitive_topology: wgpu::PrimitiveTopology::TriangleStrip,
color_states: Borrowed(&[wgpu::ColorStateDescriptor {
+1 -3
View File
@@ -62,9 +62,7 @@ impl Example {
rasterization_state: Some(wgpu::RasterizationStateDescriptor {
front_face: wgpu::FrontFace::Ccw,
cull_mode: wgpu::CullMode::None,
depth_bias: 0,
depth_bias_slope_scale: 0.0,
depth_bias_clamp: 0.0,
..Default::default()
}),
primitive_topology: wgpu::PrimitiveTopology::LineList,
color_states: Cow::Borrowed(&[wgpu::ColorStateDescriptor {
+6 -3
View File
@@ -203,6 +203,10 @@ impl Example {
}
impl framework::Example for Example {
fn needed_features() -> wgpu::Features {
wgpu::Features::DEPTH_CLAMPING
}
fn init(
sc_desc: &wgpu::SwapChainDescriptor,
device: &wgpu::Device,
@@ -483,6 +487,7 @@ impl framework::Example for Example {
depth_bias: 2, // corresponds to bilinear filtering
depth_bias_slope_scale: 2.0,
depth_bias_clamp: 0.0,
clamp_depth: device.features().contains(wgpu::Features::DEPTH_CLAMPING),
}),
primitive_topology: wgpu::PrimitiveTopology::TriangleList,
color_states: Borrowed(&[]),
@@ -609,9 +614,7 @@ impl framework::Example for Example {
rasterization_state: Some(wgpu::RasterizationStateDescriptor {
front_face: wgpu::FrontFace::Ccw,
cull_mode: wgpu::CullMode::Back,
depth_bias: 0,
depth_bias_slope_scale: 0.0,
depth_bias_clamp: 0.0,
..Default::default()
}),
primitive_topology: wgpu::PrimitiveTopology::TriangleList,
color_states: Borrowed(&[wgpu::ColorStateDescriptor {
+1 -3
View File
@@ -102,9 +102,7 @@ impl framework::Example for Skybox {
rasterization_state: Some(wgpu::RasterizationStateDescriptor {
front_face: wgpu::FrontFace::Cw,
cull_mode: wgpu::CullMode::None,
depth_bias: 0,
depth_bias_slope_scale: 0.0,
depth_bias_clamp: 0.0,
..Default::default()
}),
primitive_topology: wgpu::PrimitiveTopology::TriangleList,
color_states: Borrowed(&[wgpu::ColorStateDescriptor {
+1 -3
View File
@@ -269,9 +269,7 @@ impl framework::Example for Example {
rasterization_state: Some(wgpu::RasterizationStateDescriptor {
front_face: wgpu::FrontFace::Ccw,
cull_mode: wgpu::CullMode::None,
depth_bias: 0,
depth_bias_slope_scale: 0.0,
depth_bias_clamp: 0.0,
..Default::default()
}),
primitive_topology: wgpu::PrimitiveTopology::TriangleList,
color_states: Borrowed(&[wgpu::ColorStateDescriptor {
+2 -6
View File
@@ -504,9 +504,7 @@ impl framework::Example for Example {
rasterization_state: Some(wgpu::RasterizationStateDescriptor {
front_face: wgpu::FrontFace::Cw,
cull_mode: wgpu::CullMode::None,
depth_bias: 0,
depth_bias_slope_scale: 0.0,
depth_bias_clamp: 0.0,
..Default::default()
}),
// What kind of data are we passing in?
primitive_topology: wgpu::PrimitiveTopology::TriangleList,
@@ -577,9 +575,7 @@ impl framework::Example for Example {
rasterization_state: Some(wgpu::RasterizationStateDescriptor {
front_face: wgpu::FrontFace::Ccw,
cull_mode: wgpu::CullMode::Front,
depth_bias: 0,
depth_bias_slope_scale: 0.0,
depth_bias_clamp: 0.0,
..Default::default()
}),
primitive_topology: wgpu::PrimitiveTopology::TriangleList,
color_states: Borrowed(&[wgpu::ColorStateDescriptor {