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§
- command
- descriptor
- device
- A device represents an instance of connection to a physical device.
- entry
- An Entry are the base loaded function pointers to Vulkan.
- framebuffer
- instance
- An instance represents an instance of Vulkan application.
- memory
- physical_
device - A physical device represents a real physical device on the system.
- pipeline
- prelude
- queue
- render_
pass - resource
- Resources are both buffers and images
- shader
- surface
- A surface represents a connection between Vulkan and a window.
- swapchain
- Swapchain is a set of image buffers which handles presentation and tearing.
- sync
- util
- Utilities and macros.
Macros§
- VSend
Sync - Does nothing.
- color_
blend_ state_ expr - Expands to
vk::PipelineColorBlendAttachmentStateBuilder. - const_
queue_ present - This macro is intended to substitute for const generics when transforming input arguments to the Swapchain::present function.
- const_
queue_ submit - This macro is intended to substitute for const generics when transforming input arguments to the Queue::submit function.
- create_
graphics_ pipeline - Graphics pipeline creation macro that makes it easier to specify parameters.
- debugize_
struct - deref_
enum_ dispatch - Simple enum dispatch using
Deref. Suitable for mixed dispatch enums. - impl_
common_ handle_ traits - Implements
Borrow,Deref,PartialEq,Eq,Hash,PartialOrdandOrdfor a type based on itsBorrowimplementation. - iter_
once_ chain - Creates a chain of
std::iter::oncewrapper values. - lock_
and_ deref_ closure - Creates two fixed-size arrays. The first one holds locks and the second one holds deref of those locks.
- log_
trace_ common - offsetable_
struct - Creates a
repr(C)struct and a companion offsets struct which represents byte offsets of the fields. - render_
pass_ description - Generates render pass attachment descriptions and subpass descriptions.
- shader_
block_ struct - Creates a struct that is layout-compatible with glsl shader struct/block definition.
- shader_
specialization_ constants - shader_
util_ macro - Utility macro that can resolve GLSL shader types into Rust primitive types and Vulkan format values.
- unsafe_
enum_ variants - 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.
- vertex_
input_ description - Generates input binding descriptions and input attribute descriptions for pipeline shaders.
- viewport_
scissor_ expr - Expands to a tuple of
(vk::Viewport, vk::Rect2D)or into a tuple of([vk::Viewport], [vk::Rect2D], bool, bool). - vk_
builder_ wrap - Wraps an ash builder in a
#[repr(transparent)]struct. - vk_
enum_ subset - Creates a subset of a vk enum, which is defined as an i32 struct with associated constants.
- vk_
result_ error - Generates a public enum that derives
thiserror::ErrorwithVkResultvariants and theirFromimpls.
Constants§
- NONZERO
U32_ ONE - Non zero
1u32constant to avoid unnecessary unsafe blocks in constant contexts.