Skip to content

Commit f58ac37

Browse files
committed
Switch as_hal to return a guard
1 parent 4919356 commit f58ac37

File tree

15 files changed

+572
-339
lines changed

15 files changed

+572
-339
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ Bottom level categories:
4040

4141
## Unreleased
4242

43+
### `as_hal` calls now return guards instead of using callbacks.
44+
45+
Previously, if you wanted to get access to the wgpu-hal or underlying api types, you would call `as_hal` and get the hal type as a callback. Now the function returns a guard which dereferences to the hal type.
46+
47+
```diff
48+
- device.as_hal::<hal::api::Vulkan>(|hal_device| {...});
49+
+ let hal_device: impl Deref<Item = hal::vulkan::Device> = device.as_hal::<hal::api::Vulkan>();
50+
```
51+
4352
### New Features
4453

4554
#### Naga

0 commit comments

Comments
 (0)