Skip to content

Commit

Permalink
wgpu: Use Depth32FloatStencil8 over Depth24PlusStencil8
Browse files Browse the repository at this point in the history
Credit to @crumblingstatue.

Per `wgpu` documentation, the latter has wider support than the former.

Fixes #8295, #8296.
  • Loading branch information
relrelb committed Oct 15, 2022
1 parent b1665c4 commit 04a6cc1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion render/wgpu/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ async fn request_device(
.request_device(
&wgpu::DeviceDescriptor {
label: None,
features: wgpu::Features::DEPTH24PLUS_STENCIL8,
features: wgpu::Features::DEPTH32FLOAT_STENCIL8,
limits,
},
trace_path,
Expand Down
2 changes: 1 addition & 1 deletion render/wgpu/src/pipelines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ fn create_shape_pipeline(
shader,
&pipeline_layout,
Some(wgpu::DepthStencilState {
format: wgpu::TextureFormat::Depth24PlusStencil8,
format: wgpu::TextureFormat::Depth32FloatStencil8,
depth_write_enabled: false,
depth_compare: wgpu::CompareFunction::Always,
stencil: wgpu::StencilState {
Expand Down
2 changes: 1 addition & 1 deletion render/wgpu/src/surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl DepthTexture {
mip_level_count: 1,
sample_count: msaa_sample_count,
dimension: wgpu::TextureDimension::D2,
format: wgpu::TextureFormat::Depth24PlusStencil8,
format: wgpu::TextureFormat::Depth32FloatStencil8,
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
});

Expand Down

0 comments on commit 04a6cc1

Please sign in to comment.