diff --git a/wgpu-core/src/device/resource.rs b/wgpu-core/src/device/resource.rs index 8caea3ac6..0af4516bb 100644 --- a/wgpu-core/src/device/resource.rs +++ b/wgpu-core/src/device/resource.rs @@ -991,6 +991,8 @@ impl Device { texture: &Arc>, desc: &resource::TextureViewDescriptor, ) -> Result>, resource::CreateTextureViewError> { + self.check_is_valid()?; + let snatch_guard = texture.device.snatchable_lock.read(); let texture_raw = texture.try_raw(&snatch_guard)?; diff --git a/wgpu-core/src/resource.rs b/wgpu-core/src/resource.rs index 1929b9f8f..590de4747 100644 --- a/wgpu-core/src/resource.rs +++ b/wgpu-core/src/resource.rs @@ -1632,6 +1632,8 @@ impl TextureView { #[derive(Clone, Debug, Error)] #[non_exhaustive] pub enum CreateTextureViewError { + #[error(transparent)] + Device(#[from] DeviceError), #[error("TextureId {0:?} is invalid")] InvalidTextureId(TextureId), #[error(transparent)]