diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index c2490a3af4..68e0c1615d 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -3323,6 +3323,18 @@ impl Global { fid.assign_error(label.borrow_or_default(), &mut token); } + /// Assign `id_in` an error with the given `label`. + /// + /// See `create_buffer_error` for more context and explaination. + pub fn create_texture_error(&self, id_in: Input, label: Label) { + let hub = A::hub(self); + let mut token = Token::root(); + let fid = hub.textures.prepare(id_in); + + let (_, mut token) = hub.devices.read(&mut token); + fid.assign_error(label.borrow_or_default(), &mut token); + } + #[cfg(feature = "replay")] pub fn device_wait_for_buffer( &self,