Skip to content

Commit

Permalink
Update wgpu dependency from 0.17.1 to 0.18.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
kpreid committed Oct 25, 2023
1 parent 280ef93 commit 8c06066
Show file tree
Hide file tree
Showing 8 changed files with 151 additions and 66 deletions.
180 changes: 128 additions & 52 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ trycmd = "0.14.1" # keep in sync with `snapbox`
unicode-segmentation = { version = "1.10.1", default-features = false }
wasm-bindgen-futures = "0.4.34"
# Note: "expose_ids" feature is not needed globally but is enabled to avoid compiling two versions
wgpu = { version = "0.17.0", features = ["expose-ids"] }
wgpu = { version = "0.18.0", features = ["expose-ids"] }
yield-progress = { version = "0.1.4", default-features = false }

[profile.dev]
Expand Down
17 changes: 12 additions & 5 deletions all-is-cubes-gpu/src/in_wgpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,11 @@ impl<I: time::Instant> EverythingRenderer<I> {
pub fn device_descriptor() -> wgpu::DeviceDescriptor<'static> {
wgpu::DeviceDescriptor {
features: wgpu::Features::empty(),
limits: wgpu::Limits::downlevel_webgl2_defaults()
.using_resolution(wgpu::Limits::default()),
limits: wgpu::Limits {
max_inter_stage_shader_components: 32, // number used by blocks-and-lines shader
..wgpu::Limits::downlevel_webgl2_defaults()
.using_resolution(wgpu::Limits::default())
},
label: None,
}
}
Expand Down Expand Up @@ -598,7 +601,10 @@ impl<I: time::Instant> EverythingRenderer<I> {
},
// We need to store the depth buffer if and only if we are going to do
// the lines pass.
self.lines_vertex_count > 0,
match self.lines_vertex_count > 0 {
true => wgpu::StoreOp::Store,
false => wgpu::StoreOp::Discard,
},
)?
} else {
SpaceDrawInfo::default()
Expand All @@ -614,10 +620,11 @@ impl<I: time::Instant> EverythingRenderer<I> {
view: depth_texture_view,
depth_ops: Some(wgpu::Operations {
load: wgpu::LoadOp::Load,
store: false, // nothing uses the depth buffer after this
store: wgpu::StoreOp::Discard, // nothing uses the depth buffer after this
}),
stencil_ops: None,
}),
..Default::default()
});
render_pass.set_pipeline(&self.pipelines.lines_render_pipeline);
render_pass.set_bind_group(0, sr.camera_bind_group(), &[]);
Expand All @@ -644,7 +651,7 @@ impl<I: time::Instant> EverythingRenderer<I> {
} else {
wgpu::LoadOp::Load
},
false, // nothing uses the ui depth buffer
wgpu::StoreOp::Discard, // nothing uses the ui depth buffer
)?
} else {
SpaceDrawInfo::default()
Expand Down
4 changes: 2 additions & 2 deletions all-is-cubes-gpu/src/in_wgpu/bloom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,10 @@ impl BloomResources {
resolve_target: None,
ops: wgpu::Operations {
load: wgpu::LoadOp::Clear(wgpu::Color::BLACK),
store: true,
store: wgpu::StoreOp::Store,
},
})],
depth_stencil_attachment: None,
..Default::default()
});
render_pass.execute_bundles([bundle]);
}
Expand Down
2 changes: 1 addition & 1 deletion all-is-cubes-gpu/src/in_wgpu/frame_texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ impl FramebufferTextures {
resolve_target: self.linear_scene_resolved_view.as_ref(),
ops: wgpu::Operations {
load: color_load_op,
store: true,
store: wgpu::StoreOp::Store,
},
}
}
Expand Down
4 changes: 2 additions & 2 deletions all-is-cubes-gpu/src/in_wgpu/postprocess.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ pub(crate) fn postprocess<I: time::Instant>(
resolve_target: None,
ops: wgpu::Operations {
load: wgpu::LoadOp::Load,
store: true,
store: wgpu::StoreOp::Store,
},
})],
depth_stencil_attachment: None,
..Default::default()
});

render_pass.set_pipeline(&ev.postprocess_render_pipeline);
Expand Down
5 changes: 3 additions & 2 deletions all-is-cubes-gpu/src/in_wgpu/shader_testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ where
{
// TODO: not using all of fbt's services
let mut render_pass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor {
label: None,
label: Some("shader test render pass"),
// Clear with a nonzero color so that if something goes wrong and the full screen
// triangle isn't drawn, we know that we're not just reading zeroed memory or a zero
// result.
Expand All @@ -200,10 +200,11 @@ where
view: &fbt.depth_texture_view,
depth_ops: Some(wgpu::Operations {
load: wgpu::LoadOp::Clear(1.0),
store: false,
store: wgpu::StoreOp::Discard,
}),
stencil_ops: None,
}),
..Default::default()
});
render_pass.set_bind_group(0, &camera_buffer.bind_group, &[]);
render_pass.set_bind_group(1, &space_bind_group, &[]);
Expand Down
3 changes: 2 additions & 1 deletion all-is-cubes-gpu/src/in_wgpu/space.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ impl<I: time::Instant> SpaceRenderer<I> {
pipelines: &Pipelines,
camera: &Camera,
color_load_op: wgpu::LoadOp<wgpu::Color>,
store_depth: bool,
store_depth: wgpu::StoreOp,
) -> Result<SpaceDrawInfo, GraphicsResourceError> {
let start_time = I::now();

Expand Down Expand Up @@ -326,6 +326,7 @@ impl<I: time::Instant> SpaceRenderer<I> {
}),
stencil_ops: None,
}),
..Default::default()
});
render_pass.set_bind_group(0, &self.camera_buffer.bind_group, &[]);
if let Some(space_bind_group) = self.space_bind_group.get() {
Expand Down

0 comments on commit 8c06066

Please sign in to comment.