[][src]Crate vulkayes_core

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

pub use ash;
pub use log;
pub use seq_macro;

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

VSendSync

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, PartialOrd and Ord for a type based on its Borrow implementation.

iter_once_chain

Creates a chain of std::iter::once wrapper 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::Error with VkResult variants and their From impls.

Constants

NONZEROU32_ONE

Non zero 1u32 constant to avoid unnecessary unsafe blocks in constant contexts.