Crates.io | nobs-vk |
lib.rs | nobs-vk |
version | 0.2.0 |
source | src |
created_at | 2019-01-01 20:17:34.706016 |
updated_at | 2019-02-24 14:40:50.181807 |
description | A very basic, non rich wrapper for binding vulkan commands and extension loading |
homepage | |
repository | https://github.com/dopitz/vulkanism/vulkanism/nobs-vk |
max_upload_size | |
id | 104876 |
size | 1,798,771 |
no bullshit vulkan bindings.
This crate is auto generated by python scripts and provides types, constants and functions for vulkan.
Why does nobs-vk exists? nobs-vk...
While more involved wrappers for vulkan do exist they also strife to completely hide the vulkan api behind another layer of rust code and might force you into design decisions you would normally avoid. This library tries to be as simple as possible by just exposing callable functions to vulkan.
Find a complete documentation of this library at docs.rs.
To use nobs-vk you need a GPU with vulkan compatible drivers installed on your system. Optionally you may choose to install the vulkan sdk.
Right now the only tested environment is linux. Contributions are welcome!
When using a NVIDIA GPU, install the proprietary driver from NVIDIA (full support for vulkan 1.1 since driver version 387).
# apt install vulkan-utils
On AMD and Intel GPUs it is enough to install the packages (in case of apt):
# apt install libvulkan1 mesa-vulkan-drivers vulkan-utils
Install a current driver for your GPU and the vulkan sdk. TODO: Try if that actually works...
TODO: no idea, who uses that?
Since the idea of this library is to NOT introduce more complexity to the already existing vulkan API, please refer to the official vulkan documentation or referece. Here we only briefly give an introduction on how to set things up:
First we to initialize the library:
extern crate nobs_vk as vk;
let vk_lib = vk::VkLib::new(); // or with_feature(vk::VERSION_x_x) to use specific feature level
Note: VkLib function are both bound as members of the vk::VkLib
object, as well as free functions in the vk
namespace
There is no second.
However it is required to only have a single instance maximum of VkLib
at any given time. It's not a problem to drop the instance and create another one. After library initilization we can call vulkan commands in two ways:
VkLib
e.g:vk_lib.CreateInstance(&info, std::ptr::null(), &mut handle);
vk::CreateInstance(&info, std::ptr::null(), &mut handle);
The rust library may be built with python generate/generate.py
. This will replace the lib.rs in the src directory.
Feel encouraged to contribute! Especially everything that helps to make this library run on all varieties of platforms would be useful at this stage of the project.