diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cde0f075e..b07b91ba81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -183,6 +183,7 @@ Additionally `Surface::get_default_config` now returns an Option and returns Non - Allow non-filtering sampling of integer textures. By @JMS55 in [#3362](https://github.com/gfx-rs/wgpu/pull/3362). - Validate texture ids in `Global::queue_texture_write`. By @jimblandy in [#3378](https://github.com/gfx-rs/wgpu/pull/3378). - Don't panic on mapped buffer in queue_submit. By @crowlKats in [#3364](https://github.com/gfx-rs/wgpu/pull/3364). +- Fix being able to sample a depth texture with a filtering sampler. By @teoxoy in [#3394](https://github.com/gfx-rs/wgpu/pull/3394). #### Metal - Fix texture view creation with full-resource views when using an explicit `mip_level_count` or `array_layer_count`. By @cwfitzgerald in [#3323](https://github.com/gfx-rs/wgpu/pull/3323) diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index db691f2e55..2cc49d376a 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -2139,8 +2139,8 @@ impl Device { (Tst::Float { filterable: false }, Tst::Float { .. }) | // if we expect filterable, require it (Tst::Float { filterable: true }, Tst::Float { filterable: true }) | - // if we expect float, also accept depth - (Tst::Float { .. }, Tst::Depth, ..) => {} + // if we expect non-filterable, also accept depth + (Tst::Float { filterable: false }, Tst::Depth) => {} // if we expect filterable, also accept Float that is defined as // unfilterable if filterable feature is explicitly enabled (only hit // if wgt::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES is diff --git a/wgpu/examples/water/main.rs b/wgpu/examples/water/main.rs index 3eb08940b9..8c410501ac 100644 --- a/wgpu/examples/water/main.rs +++ b/wgpu/examples/water/main.rs @@ -382,7 +382,7 @@ impl framework::Example for Example { visibility: wgpu::ShaderStages::FRAGMENT, ty: wgpu::BindingType::Texture { multisampled: false, - sample_type: wgpu::TextureSampleType::Float { filterable: true }, + sample_type: wgpu::TextureSampleType::Float { filterable: false }, view_dimension: wgpu::TextureViewDimension::D2, }, count: None,