From 04a6cc135182d3b548b741dafde4b268a43c6411 Mon Sep 17 00:00:00 2001 From: relrelb Date: Sat, 15 Oct 2022 15:56:16 +0300 Subject: [PATCH] wgpu: Use `Depth32FloatStencil8` over `Depth24PlusStencil8` Credit to @crumblingstatue. Per `wgpu` documentation, the latter has wider support than the former. Fixes #8295, #8296. --- render/wgpu/src/backend.rs | 2 +- render/wgpu/src/pipelines.rs | 2 +- render/wgpu/src/surface.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/render/wgpu/src/backend.rs b/render/wgpu/src/backend.rs index e9d6587cbe6c..c847be8faeac 100644 --- a/render/wgpu/src/backend.rs +++ b/render/wgpu/src/backend.rs @@ -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, diff --git a/render/wgpu/src/pipelines.rs b/render/wgpu/src/pipelines.rs index 1dfab0519f5f..040d965f4f27 100644 --- a/render/wgpu/src/pipelines.rs +++ b/render/wgpu/src/pipelines.rs @@ -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 { diff --git a/render/wgpu/src/surface.rs b/render/wgpu/src/surface.rs index 2d78fff67e98..6af6685d5d83 100644 --- a/render/wgpu/src/surface.rs +++ b/render/wgpu/src/surface.rs @@ -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, });