diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index cf95f61b8b..68a012eced 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -751,6 +751,10 @@ impl Device { } } + let format_features = self + .describe_format_features(adapter, desc.format) + .map_err(|error| CreateTextureError::MissingFeatures(desc.format, error))?; + if desc.sample_count > 1 { if desc.mip_level_count != 1 { return Err(CreateTextureError::InvalidMipLevelCount { @@ -775,8 +779,7 @@ impl Device { return Err(CreateTextureError::MultisampledNotRenderAttachment); } - if !format_desc - .guaranteed_format_features + if !format_features .flags .contains(wgt::TextureFormatFeatureFlags::MULTISAMPLE) { @@ -793,10 +796,6 @@ impl Device { }); } - let format_features = self - .describe_format_features(adapter, desc.format) - .map_err(|error| CreateTextureError::MissingFeatures(desc.format, error))?; - let missing_allowed_usages = desc.usage - format_features.allowed_usages; if !missing_allowed_usages.is_empty() { return Err(CreateTextureError::InvalidFormatUsages(