From eb260ba7a62de42de2ff73e2083c366cba3b096f Mon Sep 17 00:00:00 2001 From: Jinlei Li Date: Sun, 22 May 2022 23:31:15 +0800 Subject: [PATCH] metal: fix Depth24Plus | Depth24PlusStencil8 capabilities (#2686) --- wgpu-hal/src/metal/adapter.rs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/wgpu-hal/src/metal/adapter.rs b/wgpu-hal/src/metal/adapter.rs index 28ae85ac08..2f60f50718 100644 --- a/wgpu-hal/src/metal/adapter.rs +++ b/wgpu-hal/src/metal/adapter.rs @@ -181,20 +181,24 @@ impl crate::Adapter for super::Adapter { flags } Tf::Depth32Float | Tf::Depth32FloatStencil8 => { - let mut flats = + let mut flags = Tfc::DEPTH_STENCIL_ATTACHMENT | Tfc::MULTISAMPLE | msaa_resolve_apple3x_if; if pc.format_depth32float_filter { - flats |= Tfc::SAMPLED_LINEAR + flags |= Tfc::SAMPLED_LINEAR } - flats + flags } - Tf::Depth24Plus => Tfc::empty(), - Tf::Depth24PlusStencil8 => { - if pc.msaa_desktop { - Tfc::DEPTH_STENCIL_ATTACHMENT | Tfc::SAMPLED_LINEAR | Tfc::MULTISAMPLE + Tf::Depth24Plus | Tf::Depth24PlusStencil8 => { + let mut flags = Tfc::DEPTH_STENCIL_ATTACHMENT | Tfc::MULTISAMPLE; + if pc.format_depth24_stencil8 { + flags |= Tfc::SAMPLED_LINEAR | Tfc::MULTISAMPLE_RESOLVE } else { - Tfc::empty() + flags |= msaa_resolve_apple3x_if; + if pc.format_depth32float_filter { + flags |= Tfc::SAMPLED_LINEAR + } } + flags } Tf::Rgb9e5Ufloat => { if pc.msaa_apple3 {