Added option loading example
This commit is contained in:
parent
c6a13fbe08
commit
03d44a42df
1 changed files with 72 additions and 66 deletions
|
@ -91,6 +91,12 @@ Ash also takes care of loading the function pointers. Function pointers are spli
|
|||
let device: Device = instance.create_device(pdevice, &device_create_info)
|
||||
.unwrap();
|
||||
```
|
||||
Additionally, every Vulkan extensions has to be loaded explicity. You can find all extensions under [ash::extensions](https://github.com/MaikKlein/ash/tree/master/src/extensions). You still have to tell Vulkan which instance or device extensions you want to load.
|
||||
```Rust
|
||||
use ash::extensions::Swapchain;
|
||||
let swapchain_loader = Swapchain::new(&instance, &device).expect("Unable to load swapchain");
|
||||
let swapchain = swapchain_loader.create_swapchain_khr(&swapchain_create_info).unwrap();
|
||||
```
|
||||
You don't have to pass an Instance or Device handle anymore, this is done implicitly for you.
|
||||
```Rust
|
||||
// C
|
||||
|
|
Loading…
Add table
Reference in a new issue