From 1e403e12a3c8687fe4f0de80fbc9b83d0aa9f897 Mon Sep 17 00:00:00 2001 From: Connor Fitzgerald Date: Wed, 23 Feb 2022 00:23:56 -0500 Subject: [PATCH] Always check texture features if we're running on a downlevel platform --- wgpu-core/src/device/mod.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index 51168a044..269987816 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -2735,10 +2735,13 @@ impl Device { let format_desc = format.describe(); self.require_features(format_desc.required_features)?; - if self + let using_device_features = self .features - .contains(wgt::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES) - { + .contains(wgt::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES); + // If we're running downlevel, we need to manually ask the backend what we can use as we can't trust WebGPU. + let downlevel = !self.downlevel.is_webgpu_compliant(); + + if using_device_features || downlevel { Ok(adapter.get_texture_format_features(format)) } else { Ok(format_desc.guaranteed_format_features)