Expand description
This crate provides core components for the vulkayes project.
§Crate features:
§host_allocator
and rust_host_allocator
host_allocator
adds Custom
variant to HostMemoryAllocator
. This makes the type sized, but enables the use of custom host memory allocators.
rust_host_allocator
adds Rust()
constructor to HostMemoryAllocator
that uses Rusts std::alloc
methods. Requires host_allocator
feature.
§naive_device_allocator
Adds a simple memory allocator NaiveDeviceMemoryAllocator
that allocates memory for each resource separately.
It should not be used in production applications.
§multi_thread
Enables multi thread support by using Arc<T>
and Mutex<T>
(dubbed as Vrc
and Vutex
) instead of Rc<T>
and RefCell<T>
(wrapped to have compatible API).
§parking_lot_vutex
Uses Mutex
from parking_lot
crate instead of the standard library. Requires multi_thread
feature.
§insecure_hash
Uses rustc_hash::{FxHashMap, FxHashSet}
instead of std::collections::{HashMap, HashSet}
(dubbed as VHashMap
and VHashSet
).
§runtime_implicit_validations
Some implicit validations cannot be checked statically. This feature enables runtime checks of those validations. Note that in some circumstances, such as Instance creation and extension name checking, the validation is part of the input argument transformation and turning it off would not bring any advantages.
These validations might not be cheap. It is recommended to only enabled them when debugging, not in release/production builds.
§vulkan1_1
and vulkan1_2
vulkan1_1
enables methods that will panic on Vulkan 1.0
vulkan1_2
enables methods that will panic on Vulkan 1.0 and 1.1. Requires vulkan1_1
feature.
§log_max_level_*
and log_release_max_level_*
These features directly correspond to the features on the log
crate.
Re-exports§
Modules§
- A device represents an instance of connection to a physical device.
- An Entry are the base loaded function pointers to Vulkan.
- An instance represents an instance of Vulkan application.
- A physical device represents a real physical device on the system.
- Resources are both buffers and images
- A surface represents a connection between Vulkan and a window.
- Swapchain is a set of image buffers which handles presentation and tearing.
- Utilities and macros.
Macros§
- Does nothing.
- Expands to
vk::PipelineColorBlendAttachmentStateBuilder
. - This macro is intended to substitute for const generics when transforming input arguments to the Swapchain::present function.
- This macro is intended to substitute for const generics when transforming input arguments to the Queue::submit function.
- Graphics pipeline creation macro that makes it easier to specify parameters.
- Simple enum dispatch using
Deref
. Suitable for mixed dispatch enums. - Implements
Borrow
,Deref
,PartialEq
,Eq
,Hash
,PartialOrd
andOrd
for a type based on itsBorrow
implementation. - Creates a chain of
std::iter::once
wrapper values. - Creates two fixed-size arrays. The first one holds locks and the second one holds deref of those locks.
- Creates a
repr(C)
struct and a companion offsets struct which represents byte offsets of the fields. - Generates render pass attachment descriptions and subpass descriptions.
- Creates a struct that is layout-compatible with glsl shader struct/block definition.
- Utility macro that can resolve GLSL shader types into Rust primitive types and Vulkan format values.
- Generates a private enum and a public newtype struct that only has that enum as a value. Also generated constructors on the struct that match the enum variants.
- Generates input binding descriptions and input attribute descriptions for pipeline shaders.
- Expands to a tuple of
(vk::Viewport, vk::Rect2D)
or into a tuple of([vk::Viewport], [vk::Rect2D], bool, bool)
. - Wraps an ash builder in a
#[repr(transparent)]
struct. - Creates a subset of a vk enum, which is defined as an i32 struct with associated constants.
- Generates a public enum that derives
thiserror::Error
withVkResult
variants and theirFrom
impls.
Constants§
- Non zero
1u32
constant to avoid unnecessary unsafe blocks in constant contexts.