Added option loading example

This commit is contained in:
maik klein 2016-12-23 21:41:16 +01:00
parent c6a13fbe08
commit 03d44a42df

View file

@ -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) let device: Device = instance.create_device(pdevice, &device_create_info)
.unwrap(); .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. You don't have to pass an Instance or Device handle anymore, this is done implicitly for you.
```Rust ```Rust
// C // C