From 4139175fd97e6a0d93fc880d93b5954fb6ec01b6 Mon Sep 17 00:00:00 2001 From: Connor Fitzgerald Date: Wed, 22 Mar 2023 17:30:41 -0400 Subject: [PATCH] v0.15.3 (#3616) Fix Metal Mipmap Behvior (#3610) --- CHANGELOG.md | 10 ++++++---- Cargo.lock | 2 +- wgpu-hal/Cargo.toml | 2 +- wgpu-hal/src/metal/adapter.rs | 1 - wgpu-hal/src/metal/device.rs | 7 +------ wgpu-hal/src/metal/mod.rs | 1 - 6 files changed, 9 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 270a1ba25..a0758174f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,13 +39,15 @@ Bottom level categories: --> ## Unreleased + +## v0.15.3 (2023-03-22) ### Bug Fixes + +#### Metal +- Fix incorrect mipmap being sampled when using `MinLod <= 0.0` and `MaxLod >= 32.0` or when the fragment shader samples different Lods in the same quad. By @cwfitzgerald in [#3610](https://github.com/gfx-rs/wgpu/pull/3610). + #### GLES - Fix `Vertex buffer is not big enough for the draw call.` for ANGLE/Web when rendering with instance attributes on a single instance. By @wumpf in [#3596](https://github.com/gfx-rs/wgpu/pull/3596) - -### Bug Fixes - -#### GLES - Reset all queue state between command buffers in a submit. By @jleibs [#3589](https://github.com/gfx-rs/wgpu/pull/3589) - Reset the state of `SAMPLE_ALPHA_TO_COVERAGE` on queue reset. By @jleibs [#3589](https://github.com/gfx-rs/wgpu/pull/3589) diff --git a/Cargo.lock b/Cargo.lock index e83c85ad6..56893553a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3017,7 +3017,7 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.15.3" +version = "0.15.4" dependencies = [ "android_system_properties", "arrayvec 0.7.2", diff --git a/wgpu-hal/Cargo.toml b/wgpu-hal/Cargo.toml index 9f679d964..c6e6af296 100644 --- a/wgpu-hal/Cargo.toml +++ b/wgpu-hal/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wgpu-hal" -version = "0.15.3" +version = "0.15.4" authors = ["wgpu developers"] edition = "2021" description = "WebGPU hardware abstraction layer" diff --git a/wgpu-hal/src/metal/adapter.rs b/wgpu-hal/src/metal/adapter.rs index 7ecea2f31..d560e6126 100644 --- a/wgpu-hal/src/metal/adapter.rs +++ b/wgpu-hal/src/metal/adapter.rs @@ -537,7 +537,6 @@ impl super::PrivateCapabilities { MUTABLE_COMPARISON_SAMPLER_SUPPORT, ), sampler_clamp_to_border: Self::supports_any(device, SAMPLER_CLAMP_TO_BORDER_SUPPORT), - sampler_lod_average: { version.at_least((11, 0), (9, 0), os_is_mac) }, base_instance: Self::supports_any(device, BASE_INSTANCE_SUPPORT), base_vertex_instance_drawing: Self::supports_any(device, BASE_VERTEX_INSTANCE_SUPPORT), dual_source_blending: Self::supports_any(device, DUAL_SOURCE_BLEND_SUPPORT), diff --git a/wgpu-hal/src/metal/device.rs b/wgpu-hal/src/metal/device.rs index 8ba2702ee..dfb7333a9 100644 --- a/wgpu-hal/src/metal/device.rs +++ b/wgpu-hal/src/metal/device.rs @@ -407,14 +407,13 @@ impl crate::Device for super::Device { &self, desc: &crate::SamplerDescriptor, ) -> DeviceResult { - let caps = &self.shared.private_caps; objc::rc::autoreleasepool(|| { let descriptor = mtl::SamplerDescriptor::new(); descriptor.set_min_filter(conv::map_filter_mode(desc.min_filter)); descriptor.set_mag_filter(conv::map_filter_mode(desc.mag_filter)); descriptor.set_mip_filter(match desc.mipmap_filter { - wgt::FilterMode::Nearest if desc.lod_clamp.is_none() => { + wgt::FilterMode::Nearest if desc.lod_clamp == Some(0.0..0.0) => { mtl::MTLSamplerMipFilter::NotMipmapped } wgt::FilterMode::Nearest => mtl::MTLSamplerMipFilter::Nearest, @@ -435,10 +434,6 @@ impl crate::Device for super::Device { descriptor.set_lod_max_clamp(range.end); } - if caps.sampler_lod_average { - descriptor.set_lod_average(true); // optimization - } - if let Some(fun) = desc.compare { descriptor.set_compare_function(conv::map_compare_function(fun)); } diff --git a/wgpu-hal/src/metal/mod.rs b/wgpu-hal/src/metal/mod.rs index 37f101cff..061e990f9 100644 --- a/wgpu-hal/src/metal/mod.rs +++ b/wgpu-hal/src/metal/mod.rs @@ -151,7 +151,6 @@ struct PrivateCapabilities { shared_textures: bool, mutable_comparison_samplers: bool, sampler_clamp_to_border: bool, - sampler_lod_average: bool, base_instance: bool, base_vertex_instance_drawing: bool, dual_source_blending: bool,