diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d2211a32..19f175bbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/wgpu-core/src/resource.rs b/wgpu-core/src/resource.rs index 368504f6d..e609b9686 100644 --- a/wgpu-core/src/resource.rs +++ b/wgpu-core/src/resource.rs @@ -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,