mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 06:44:14 +00:00
Add create_texture_error. (#2800)
Firefox needs it to implement WebGPU's error model (see create_buffer_error).
This commit is contained in:
parent
2881a74de9
commit
a9f1b4f8e0
@ -3323,6 +3323,18 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
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<A: HalApi>(&self, id_in: Input<G, id::TextureId>, 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<A: HalApi>(
|
||||
&self,
|
||||
|
Loading…
Reference in New Issue
Block a user