From f78e2f780019f532c3e18030922c5c0ec405864a Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Sun, 10 Mar 2024 20:56:58 +0100 Subject: [PATCH] GL actually supports DEPTH32FLOAT_STENCIL8 (#5370) --- CHANGELOG.md | 1 + tests/tests/clear_texture.rs | 1 + wgpu-hal/src/gles/adapter.rs | 3 ++- wgpu-types/src/lib.rs | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be2adbc4e..9a126071c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -122,6 +122,7 @@ By @cwfitzgerald in [#5325](https://github.com/gfx-rs/wgpu/pull/5325). - Log an error when GLES texture format heuristics fail. By @PolyMeilex in [#5266](https://github.com/gfx-rs/wgpu/issues/5266) - Cache the sample count to keep `get_texture_format_features` cheap. By @Dinnerbone in [#5346](https://github.com/gfx-rs/wgpu/pull/5346) +- Mark `DEPTH32FLOAT_STENCIL8` as supported in GLES. By @Dinnerbone in [#5370](https://github.com/gfx-rs/wgpu/pull/5370) ### Bug Fixes diff --git a/tests/tests/clear_texture.rs b/tests/tests/clear_texture.rs index 3e7484ab5..175c642b9 100644 --- a/tests/tests/clear_texture.rs +++ b/tests/tests/clear_texture.rs @@ -375,6 +375,7 @@ static CLEAR_TEXTURE_DEPTH32_STENCIL8: GpuTestConfiguration = GpuTestConfigurati .parameters( TestParameters::default() .features(wgpu::Features::CLEAR_TEXTURE | wgpu::Features::DEPTH32FLOAT_STENCIL8) + .downlevel_flags(wgpu::DownlevelFlags::DEPTH_TEXTURE_AND_BUFFER_COPIES) // https://github.com/gfx-rs/wgpu/issues/5016 .skip(FailureCase::adapter("Apple Paravirtual device")), ) diff --git a/wgpu-hal/src/gles/adapter.rs b/wgpu-hal/src/gles/adapter.rs index 094780812..c09725e85 100644 --- a/wgpu-hal/src/gles/adapter.rs +++ b/wgpu-hal/src/gles/adapter.rs @@ -436,7 +436,8 @@ impl super::Adapter { let mut features = wgt::Features::empty() | wgt::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES | wgt::Features::CLEAR_TEXTURE - | wgt::Features::PUSH_CONSTANTS; + | wgt::Features::PUSH_CONSTANTS + | wgt::Features::DEPTH32FLOAT_STENCIL8; features.set( wgt::Features::ADDRESS_MODE_CLAMP_TO_BORDER | wgt::Features::ADDRESS_MODE_CLAMP_TO_ZERO, extensions.contains("GL_EXT_texture_border_clamp") diff --git a/wgpu-types/src/lib.rs b/wgpu-types/src/lib.rs index 96b866701..d9466a3ce 100644 --- a/wgpu-types/src/lib.rs +++ b/wgpu-types/src/lib.rs @@ -274,6 +274,7 @@ bitflags::bitflags! { /// - Vulkan (mostly) /// - DX12 /// - Metal + /// - OpenGL /// /// This is a web and native feature. const DEPTH32FLOAT_STENCIL8 = 1 << 1;