mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-24 08:21:25 +01:00
[core] Do device validity check at the start of try_map_async
this is important as we need to return Abort error instead of Operation error which is raised on invalid buffer Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
1 parent
4e98175c04
commit
9e80fc9d1d
1 file changed
+5
-5
@@ -831,6 +831,11 @@ impl Buffer {
|
||||
self.size.saturating_sub(offset)
|
||||
};
|
||||
|
||||
let device = &self.device;
|
||||
if let Err(e) = device.check_is_valid() {
|
||||
return Err((callback, e.into()));
|
||||
}
|
||||
|
||||
if let Err(e) = self.check_is_valid() {
|
||||
return Err((callback, e.into()));
|
||||
}
|
||||
@@ -882,11 +887,6 @@ impl Buffer {
|
||||
return Err((callback, e.into()));
|
||||
}
|
||||
|
||||
let device = &self.device;
|
||||
if let Err(e) = device.check_is_valid() {
|
||||
return Err((callback, e.into()));
|
||||
}
|
||||
|
||||
let submit_index = {
|
||||
let snatch_guard = device.snatchable_lock.read();
|
||||
if let Err(e) = self.check_destroyed(&snatch_guard) {
|
||||
|
||||
Reference in new issue
Block a user