Don't crash in the Display implementation of CreateTextureViewError::TooMany{MipLevels,ArrayLayers} when their base and offset overflow. By @ErichDonGubler in #8808.

This commit is contained in:
Erich Gubler authored and Andreas Reich committed 2026-03-26 14:01:34 +01:00
1 parent fbaf66fbe6
commit 814eef1ca2
2 files changed
+7 -6

No files matched your search

+3
View File
@@ -52,6 +52,9 @@ Bottom level categories:
- Added guards to avoid calling some feature detection methods that are not implemented on `CaptureMTLDevice`. By @andyleiserson in [#9284](https://github.com/gfx-rs/wgpu/pull/9284).
#### Validation
- Don't crash in the `Display` implementation of `CreateTextureViewError::TooMany{MipLevels,ArrayLayers}` when their base and offset overflow. By @ErichDonGubler in [#8808](https://github.com/gfx-rs/wgpu/pull/8808).
## v29.0.0 (2026-03-18)
+4 -6
View File
@@ -1838,9 +1838,8 @@ pub enum CreateTextureViewError {
#[error("Array layer count is 0")]
ZeroArrayLayerCount,
#[error(
"TextureView spans mip levels [{base_mip_level}, {end_mip_level}) \
(mipLevelCount {mip_level_count}) but the texture view only has {total} total mip levels",
end_mip_level = base_mip_level + mip_level_count
"`TextureView` starts at mip level {base_mip_level} and spans {mip_level_count} mip \
levels, but the texture view only has {total} total mip level(s)"
)]
TooManyMipLevels {
base_mip_level: u32,
@@ -1848,9 +1847,8 @@ pub enum CreateTextureViewError {
total: u32,
},
#[error(
"TextureView spans array layers [{base_array_layer}, {end_array_layer}) \
(arrayLayerCount {array_layer_count}) but the texture view only has {total} total layers",
end_array_layer = base_array_layer + array_layer_count
"`TextureView` starts at array layer {base_array_layer} and spans {array_layer_count}) \
array layers, but the texture view only has {total} total layer(s)"
)]
TooManyArrayLayers {
base_array_layer: u32,