[][src]Crate vulkano

Safe and rich Rust wrapper around the Vulkan API.

Brief summary of Vulkan

  • The Instance object is the API entry point. It is the first object you must create before starting to use Vulkan.

  • The PhysicalDevice object represents an implementation of Vulkan available on the system (eg. a graphics card, a software implementation, etc.). Physical devices can be enumerated from an instance with PhysicalDevice::enumerate().

  • Once you have chosen a physical device to use, you can create a Device object from it. The Device is the most important object of Vulkan, as it represents an open channel of communication with a physical device. You always need to have one before you can do interesting things with Vulkan.

  • Buffers and images can be used to store data on memory accessible by the GPU (or more generally by the Vulkan implementation). Buffers are usually used to store information about vertices, lights, etc. or arbitrary data, while images are used to store textures or multi-dimensional data.

  • In order to show something on the screen, you need a Swapchain. A Swapchain contains special Images that correspond to the content of the window or the monitor. When you present a swapchain, the content of one of these special images is shown on the screen.

  • In order to ask the GPU to do something, you must create a command buffer. A command buffer contains a list of commands that the GPU must perform. This can include copies between buffers and images, compute operations, or graphics operations. For the work to start, the command buffer must then be submitted to a Queue, which is obtained when you create the Device.

  • In order to be able to add a compute operation or a graphics operation to a command buffer, you need to have created a ComputePipeline or a GraphicsPipeline object that describes the operation you want. These objects are usually created during your program's initialization. Shaders are programs that the GPU will execute as part of a pipeline. Descriptors can be used to access the content of buffers or images from within shaders.

  • For graphical operations, RenderPasses and Framebuffers describe on which images the implementation must draw upon.

  • Once you have built a command buffer that contains a list of commands, submitting it to the GPU will return an object that implements the GpuFuture trait. GpuFutures allow you to chain multiple submissions together and are essential to performing multiple operations on multiple different GPU queues.

Re-exports

pub extern crate half;

Modules

buffer

Location in memory that contains data.

command_buffer

Commands that the GPU will execute (includes draw commands).

descriptor

Provides a way for shaders to access the content of buffers and images, or read arbitrary data.

device

Communication channel with a physical device.

format

Declares all the formats of data and images supported by Vulkan.

framebuffer

Targets on which your draw commands are executed.

image

Image storage (1D, 2D, 3D, arrays, etc.).

instance

API entry point.

memory

Device memory allocation and memory pools.

pipeline

Describes a graphical or compute operation.

query

This module provides support for query pools.

sampler

How to retrieve data from an image within a shader.

swapchain

Link between Vulkan and a window and/or the screen.

sync

Synchronization on the GPU.

Macros

app_info_from_cargo_toml

Builds an ApplicationInfo from the information gathered by Cargo.

buffer_slice_field

Takes a BufferSlice that points to a struct, and returns a BufferSlice that points to a specific field of that struct.

impl_vertex

Implements the Vertex trait on a struct.

ordered_passes_renderpass

Builds a RenderPass object whose template parameter is of indeterminate type.

single_pass_renderpass

Builds a RenderPass object whose template parameter is of indeterminate type.

statically_linked_vulkan_loader

Expression that returns a loader that assumes that Vulkan is linked to the executable you're compiling.

Enums

OomError

Error type returned by most Vulkan functions.

Traits

SafeDeref

Alternative to the Deref trait. Contrary to Deref, must always return the same object.

SynchronizedVulkanObject

Gives access to the internal identifier of an object.

VulkanHandle
VulkanObject

Gives access to the internal identifier of an object.