diff --git a/wgpu-core/src/device/resource.rs b/wgpu-core/src/device/resource.rs index 240103750..880b5ed65 100644 --- a/wgpu-core/src/device/resource.rs +++ b/wgpu-core/src/device/resource.rs @@ -2121,6 +2121,13 @@ impl Device { }); } + if desc.range.aspect == wgt::TextureAspect::All && resolved_format.is_multi_planar_format() + { + return Err(resource::CreateTextureViewError::MultiplanarFullTexture( + resolved_format, + )); + } + let format_is_good = if desc.range.aspect == wgt::TextureAspect::All { resolved_format == texture.desc.format || texture.desc.view_formats.contains(&resolved_format) diff --git a/wgpu-core/src/resource.rs b/wgpu-core/src/resource.rs index c0c77f04f..e00313e65 100644 --- a/wgpu-core/src/resource.rs +++ b/wgpu-core/src/resource.rs @@ -2243,6 +2243,8 @@ pub enum CreateTextureViewError { InvalidResource(#[from] InvalidResourceError), #[error(transparent)] MissingFeatures(#[from] MissingFeatures), + #[error("TextureAspect::All cannot be used in texture views on multi-planar formats")] + MultiplanarFullTexture(wgt::TextureFormat), } impl From for CreateTextureViewError { @@ -2277,7 +2279,8 @@ impl WebGpuError for CreateTextureViewError { | Self::TextureViewFormatNotStorage(_) | Self::InvalidTextureViewUsage { .. } | Self::InvalidTransientTextureViewUsage { .. } - | Self::MissingFeatures(_) => ErrorType::Validation, + | Self::MissingFeatures(_) + | Self::MultiplanarFullTexture(_) => ErrorType::Validation, } } }