mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-20 22:41:07 +01:00
fix(core): Disallow view with TextureAspect::All on multi-planar textures (#9703)
This commit is contained in:
1 parent
888e749799
commit
a9beb0dc1f
2 files changed
+11
-1
No files matched your search
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user