fix(core): Disallow view with TextureAspect::All on multi-planar textures (#9703)

This commit is contained in:
Inner Daemons authored and GitHub committed 2026-07-16 13:39:32 -07:00
1 parent 888e749799
commit a9beb0dc1f
2 files changed
+11 -1

No files matched your search

+7
View File
@@ -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)
+4 -1
View File
@@ -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<InvalidOrDestroyedResourceError> 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,
}
}
}