[−][src]Crate erupt
Vulkan API bindings
Features
- Full Vulkan API coverage
- First-class support for all extensions
- High quality auto-generated function wrappers
- A utility module aiding your use of this crate
VulkanResult
: Idiomatic wrapper around a Vulkan Resultsurface
: Create aSurfaceKHR
using aRawWindowHandle
(adapted fromash-window
)allocator
: Provides a basic Vulkan memory allocator, aiming to be correct
- Generated code distributed into multiple modules
- Function loading (
CoreLoader
,InstanceLoader
,DeviceLoader
) - Seperate
Flags
andFlagBits
types - A high level
Builder
for every struct - Type-safe pointer chain support
Default
andDebug
implementation for every type- Complete auto-generation of everything except
utils
Example: Instance Creation
use erupt::{vk1_0::*, CoreLoader, InstanceLoader}; let mut core = CoreLoader::new()?; core.load_vk1_0()?; let app_info = ApplicationInfoBuilder::new().api_version(erupt::make_version(1, 0, 0)); let instance_info = InstanceCreateInfoBuilder::new().application_info(&app_info); let instance_handle = try_vk!(core.create_instance(&instance_info, None, None)); let mut instance = InstanceLoader::new(&core, instance_handle)?; instance.load_vk1_0()?; // ... instance.destroy_instance(None);
Additional examples
Cargo Features
surface
(enabled by default): Enables thesurface
module, addsraw-window-handle
dependencyloading
(enabled by default): Enables theCoreLoader::new
function, addslibloading
dependency
FAQ
Q: What's the difference between this, ash and vulkano?
A: Vulkano is special because it provides hand-written Vulkan wrappers, which means that for example it
has a special hand-written written wrapper around a Vulkan PhysicalDevice
. On the other hand ash and erupt
both provide Vulkan API bindings too, but not exposing such fancy wrappers and instead focusing on having
good bindings to the raw Vulkan API.
The big selling points of erupt is that it has better documentation, high level function support for all extensions (which is only really relevant if you use those extensions), being fully generated (which is not visible to the end user), having faster compile times and some more smaller improvements. On the other hand ash has a bigger existing community.
Q: How do the compile times compare to ash?
A: erupt 0.6.0+140
compiles in around 73% of the time it takes for ash 0.30.0
to compile, tested on
Linux with rustc 1.45.0-nightly (65b448273 2020-05-03)
using -Ztimings=info
.
Q: What does the number at the end of the version mean?
A: It represents the Vulkan Header version this version of erupt was generated against and is purely informational.
Thank you
vk-parse
for helping parsevk.xml
in thegenerator
ash
for helping inspiring and making this cratelibloading
for providing symbol loadingash-window
for providing a base for thesurface
modulebitflags
for providing a perfect bitflag macro- The Vulkan Community ❤️
- The Rust Community ❤️
Licensing
The logo is the Volcano Emoji of Twemoji (License). The name "erupt" was added on top of it.
This project is licensed under the zlib License.
Modules
extensions | Provides Vulkan extension items |
utils | Utilities to aid your usage of this crate |
vk1_0 | Provides Vulkan feature items |
vk1_1 | Provides Vulkan feature items |
vk1_2 | Provides Vulkan feature items |
Macros
cstr | Construct a |
try_vk | Like |
Structs
CoreLoader | Loader for Core Commands |
DeviceLoader | Loader for Device Commands |
InstanceLoader | Loader for Instance Commands |
Traits
ExtendableBy | Used in |
Functions
make_version | Vulkan Manual Page · Const Function |
version_major | Vulkan Manual Page · Const Function |
version_minor | Vulkan Manual Page · Const Function |
version_patch | Vulkan Manual Page · Const Function |