Crates.io | dacite |
lib.rs | dacite |
version | 0.7.0 |
source | src |
created_at | 2017-06-05 09:17:25.524621 |
updated_at | 2017-09-19 19:02:10.18266 |
description | Mostly safe low-level Vulkan library |
homepage | https://gitlab.com/dennis-hamester/dacite |
repository | https://gitlab.com/dennis-hamester/dacite |
max_upload_size | |
id | 17804 |
size | 811,318 |
Mostly safe Vulkan library for Rust.
Development is active and ongoing. Support for new Vulkan revisions will be added one-by-one. New extensions will also be supported along the way.
Dacite is sorely lacking in the documentation department. I don't plan to fully document every type and function (and thus effectively repeat the Vulkan specification). But at least the parts where dacite is different from the C API will be documented over time.
Rust 1.18.0 or newer is required.
Dacite is available on crates.io. Add this to your Cargo.toml
:
[dependencies]
dacite = "0.7"
Check out the examples subdirectory to get started.
The Vulkan library (or more specifically, the Vulkan icd loader) is loaded dynamically at runtime. This means, that development with dacite works out-of-the-box, without installing anything else (like C headers or the LunarG Vulkan SDK on Windows).
Dacite uses vks as its Vulkan FFI bindings and symbol loader.
Completeness and a simple mapping between the C and Rust API are probably the most important goals. As such, most of dacites responsibility lies in converting the provided Rust types to and from their C counterparts.
The Vulkan specification is very strict about what constitutes valid usage and what doesn't. The general rule is, that invalid usage results in undefined behaviour. Dacite does not in any way enforce valid API usage by its design.
I strongly suggest to check out the vulkano project, if dacite doesn't suit your requirements.
Dacite is safe, as long as it is used according to the Vulkan specification. However, invalid usage will result in undefined behaviour. Enabling the validation layers during development is a good way to prevent bad things from happening. Dacite does very little on its own in this regard.
One exception to this rule is, that the lifetime of an object is bound to its direct parent object
(dynamically, via reference counting) from which it was created. For example, an Image
will always
outlive its parent Device
. However, other dependencies are not modelled. For instance, binding
some DeviceMemory
to a Buffer
, will not ensure, that the DeviceMemory
outlives the Buffer
.
The same is true for essentially all such relationships in the Vulkan API.
Dacite follows the Semantic Versioning scheme. Although the current version is still below 1.0.0, the minor version component will be incremented whenever breaking changes are made. Version 1.0.0 will not be released, before dacite supports the most recent Vulkan revision and all extensions.
The main source of breaking API changes are new Vulkan extensions. More specifically, new variants added to an existing enum by a new extension must be considered a breaking change.
Dacites has been designed such, that all other additions by new extensions should not break existing applications. However, the development of vks has shown, that many Vulkan revisions contain minor mistakes, which are then fixed later. If one of these mistakes makes it into dacite, its removal might be breaking change.
KHR
ExtensionsExtension | Revision |
---|---|
VK_KHR_android_surface |
6 |
VK_KHR_display_swapchain |
9 |
VK_KHR_display |
21 |
VK_KHR_get_physical_device_properties2 |
1 |
VK_KHR_mir_surface |
4 |
VK_KHR_sampler_mirror_clamp_to_edge |
1 |
VK_KHR_surface |
25 |
VK_KHR_swapchain |
68 |
VK_KHR_wayland_surface |
5 |
VK_KHR_win32_surface |
5 |
VK_KHR_xcb_surface |
6 |
VK_KHR_xlib_surface |
6 |
EXT
ExtensionsExtension | Revision |
---|---|
VK_EXT_debug_marker |
3 |
VK_EXT_debug_report |
3 |
VK_EXT_validation_flags |
1 |
NV
ExtensionsExtension | Revision |
---|---|
VK_NV_dedicated_allocation |
1 |
VK_NV_external_memory_capabilities |
1 |
VK_NV_external_memory_win32 |
1 |
VK_NV_external_memory |
1 |
VK_NV_glsl_shader |
1 |
VK_NV_win32_keyed_mutex |
1 |
AMD
ExtensionsExtension | Revision |
---|---|
VK_AMD_draw_indirect_count |
1 |
VK_AMD_gcn_shader |
1 |
VK_AMD_gpu_shader_half_float |
1 |
VK_AMD_rasterization_order |
1 |
VK_AMD_shader_explicit_vertex_parameter |
1 |
VK_AMD_shader_trinary_minmax |
1 |
IMG
ExtensionsExtension | Revision |
---|---|
VK_IMG_filter_cubic |
1 |
VK_IMG_format_pvrtc |
1 |
Dacite is licensed under the ISC license:
Copyright (c) 2017, Dennis Hamester <dennis.hamester@startmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.