Skip to content

Commit 01973a9

Browse files
fix(core): handle HAL errors from query set creation (#6505)
* fix(core): handle HAL errors from query set creation * Update CHANGELOG.md Co-authored-by: Andreas Reich <[email protected]> --------- Co-authored-by: Andreas Reich <[email protected]>
1 parent b89a57f commit 01973a9

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ Bottom level categories:
6464

6565
### Bug Fixes
6666

67+
#### General
68+
69+
- Handle query set creation failure as an internal error that loses the `Device`, rather than panicking. By @ErichDonGubler in [#6505](https://github.com/gfx-rs/wgpu/pull/6505).
70+
6771
#### Naga
6872

6973
- Fix crash when a texture argument is missing. By @aedm in [#6486](https://github.com/gfx-rs/wgpu/pull/6486)

wgpu-core/src/device/resource.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3605,7 +3605,8 @@ impl Device {
36053605

36063606
let hal_desc = desc.map_label(|label| label.to_hal(self.instance_flags));
36073607

3608-
let raw = unsafe { self.raw().create_query_set(&hal_desc).unwrap() };
3608+
let raw = unsafe { self.raw().create_query_set(&hal_desc) }
3609+
.map_err(|e| self.handle_hal_error(e))?;
36093610

36103611
let query_set = QuerySet {
36113612
raw: ManuallyDrop::new(raw),

0 commit comments

Comments
 (0)