diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index e832b27ddb..bee775e0d9 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -800,9 +800,17 @@ impl Device { let missing_allowed_usages = desc.usage - format_features.allowed_usages; if !missing_allowed_usages.is_empty() { + // detect downlevel incompatibilities + let wgpu_allowed_usages = desc + .format + .describe() + .guaranteed_format_features + .allowed_usages; + let wgpu_missing_usages = desc.usage - wgpu_allowed_usages; return Err(CreateTextureError::InvalidFormatUsages( missing_allowed_usages, desc.format, + wgpu_missing_usages.is_empty(), )); } diff --git a/wgpu-core/src/resource.rs b/wgpu-core/src/resource.rs index bc7f865f39..07a7086ff1 100644 --- a/wgpu-core/src/resource.rs +++ b/wgpu-core/src/resource.rs @@ -423,8 +423,11 @@ pub enum CreateTextureError { "Texture descriptor mip level count {requested} is invalid, maximum allowed is {maximum}" )] InvalidMipLevelCount { requested: u32, maximum: u32 }, - #[error("Texture usages {0:?} are not allowed on a texture of type {1:?}")] - InvalidFormatUsages(wgt::TextureUsages, wgt::TextureFormat), + #[error( + "Texture usages {0:?} are not allowed on a texture of type {1:?}{}", + if *.2 { " due to downlevel restrictions" } else { "" } + )] + InvalidFormatUsages(wgt::TextureUsages, wgt::TextureFormat, bool), #[error("Texture usages {0:?} are not allowed on a texture of dimensions {1:?}")] InvalidDimensionUsages(wgt::TextureUsages, wgt::TextureDimension), #[error("Texture usage STORAGE_BINDING is not allowed for multisampled textures")]