diff --git a/wgpu-core/src/device/global.rs b/wgpu-core/src/device/global.rs index fea06c146..af928dfb0 100644 --- a/wgpu-core/src/device/global.rs +++ b/wgpu-core/src/device/global.rs @@ -2188,10 +2188,8 @@ impl Global { let range_size = if let Some(size) = size { size - } else if offset > buffer.size { - 0 } else { - buffer.size - offset + buffer.size.saturating_sub(offset) }; if offset % wgt::MAP_ALIGNMENT != 0 { diff --git a/wgpu-core/src/resource.rs b/wgpu-core/src/resource.rs index f7f0fd652..f8a252d7c 100644 --- a/wgpu-core/src/resource.rs +++ b/wgpu-core/src/resource.rs @@ -439,10 +439,8 @@ impl Buffer { ) -> Result { let range_size = if let Some(size) = size { size - } else if offset > self.size { - 0 } else { - self.size - offset + self.size.saturating_sub(offset) }; if offset % wgt::MAP_ALIGNMENT != 0 {