|
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `vulkano` crate."><meta name="keywords" content="rust, rustlang, rust-lang, vulkano"><title>vulkano - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../vulkano/index.html'><div class='logo-container'><img src='https://raw.githubusercontent.com/vulkano-rs/vulkano/master/logo.png' alt='logo'></div></a><p class='location'>Crate vulkano</p><div class="sidebar-elems"><a id='all-types' href='all.html'><p>See all vulkano's items</p></a><div class="block items"><ul><li><a href="#reexports">Re-exports</a></li><li><a href="#modules">Modules</a></li><li><a href="#macros">Macros</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li></ul></div><p class='location'></p><script>window.sidebarCurrent = {name: 'vulkano', ty: 'mod', relpath: '../'};</script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/vulkano/lib.rs.html#10-256' title='goto source code'>[src]</a></span><span class='in-band'>Crate <a class="mod" href=''>vulkano</a></span></h1><div class='docblock'><p>Safe and rich Rust wrapper around the Vulkan API.</p>
|
|
|
<h1 id="brief-summary-of-vulkan" class="section-header"><a href="#brief-summary-of-vulkan">Brief summary of Vulkan</a></h1>
|
|
|
<ul>
|
|
|
<li>
|
|
|
<p>The <a href="instance/struct.Instance.html"><code>Instance</code></a> object is the API entry point. It is the
|
|
|
first object you must create before starting to use Vulkan.</p>
|
|
|
</li>
|
|
|
<li>
|
|
|
<p>The <a href="instance/struct.PhysicalDevice.html"><code>PhysicalDevice</code></a> 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
|
|
|
<a href="instance/struct.PhysicalDevice.html#method.enumerate"><code>PhysicalDevice::enumerate()</code></a>.</p>
|
|
|
</li>
|
|
|
<li>
|
|
|
<p>Once you have chosen a physical device to use, you can create a
|
|
|
<a href="device/index.html"><code>Device</code></a> object from it. The <code>Device</code> 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.</p>
|
|
|
</li>
|
|
|
<li>
|
|
|
<p><a href="buffer/index.html"><em>Buffers</em></a> and <a href="image/index.html"><em>images</em></a> 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.</p>
|
|
|
</li>
|
|
|
<li>
|
|
|
<p>In order to show something on the screen, you need a <a href="swapchain/index.html"><code>Swapchain</code></a>.
|
|
|
A <code>Swapchain</code> contains special <code>Image</code>s that correspond to the content of the window or the
|
|
|
monitor. When you <em>present</em> a swapchain, the content of one of these special images is shown
|
|
|
on the screen.</p>
|
|
|
</li>
|
|
|
<li>
|
|
|
<p>In order to ask the GPU to do something, you must create a
|
|
|
<a href="command_buffer/index.html"><em>command buffer</em></a>. 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 <a href="device/struct.Queue.html"><code>Queue</code></a>, which is obtained when you create the
|
|
|
<code>Device</code>.</p>
|
|
|
</li>
|
|
|
<li>
|
|
|
<p>In order to be able to add a compute operation or a graphics operation to a command buffer,
|
|
|
you need to have created a <a href="pipeline/index.html"><code>ComputePipeline</code> or a <code>GraphicsPipeline</code>
|
|
|
object</a> that describes the operation you want. These objects are usually
|
|
|
created during your program's initialization. <code>Shader</code>s are programs that the GPU will
|
|
|
execute as part of a pipeline. <a href="descriptor/index.html"><em>Descriptors</em></a> can be used to access
|
|
|
the content of buffers or images from within shaders.</p>
|
|
|
</li>
|
|
|
<li>
|
|
|
<p>For graphical operations, <a href="framebuffer/index.html"><code>RenderPass</code>es and <code>Framebuffer</code>s</a>
|
|
|
describe on which images the implementation must draw upon.</p>
|
|
|
</li>
|
|
|
<li>
|
|
|
<p>Once you have built a <em>command buffer</em> that contains a list of commands, submitting it to the
|
|
|
GPU will return an object that implements <a href="sync/index.html">the <code>GpuFuture</code> trait</a>.
|
|
|
<code>GpuFuture</code>s allow you to chain multiple submissions together and are essential to performing
|
|
|
multiple operations on multiple different GPU queues.</p>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div><h2 id='reexports' class='section-header'><a href="#reexports">Re-exports</a></h2>
|
|
|
<table><tr><td><code>pub extern crate <a class="mod" href="../half/index.html" title="mod half">half</a>;</code></td></tr></table><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
|
|
|
<table><tr class='module-item'><td><a class="mod" href="buffer/index.html" title='vulkano::buffer mod'>buffer</a></td><td class='docblock-short'><p>Location in memory that contains data.</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="mod" href="command_buffer/index.html" title='vulkano::command_buffer mod'>command_buffer</a></td><td class='docblock-short'><p>Commands that the GPU will execute (includes draw commands).</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="mod" href="descriptor/index.html" title='vulkano::descriptor mod'>descriptor</a></td><td class='docblock-short'><p>Provides a way for shaders to access the content of buffers and images, or read arbitrary data.</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="mod" href="device/index.html" title='vulkano::device mod'>device</a></td><td class='docblock-short'><p>Communication channel with a physical device.</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="mod" href="format/index.html" title='vulkano::format mod'>format</a></td><td class='docblock-short'><p>Declares all the formats of data and images supported by Vulkan.</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="mod" href="framebuffer/index.html" title='vulkano::framebuffer mod'>framebuffer</a></td><td class='docblock-short'><p>Targets on which your draw commands are executed.</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="mod" href="image/index.html" title='vulkano::image mod'>image</a></td><td class='docblock-short'><p>Image storage (1D, 2D, 3D, arrays, etc.).</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="mod" href="instance/index.html" title='vulkano::instance mod'>instance</a></td><td class='docblock-short'><p>API entry point.</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="mod" href="memory/index.html" title='vulkano::memory mod'>memory</a></td><td class='docblock-short'><p>Device memory allocation and memory pools.</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="mod" href="pipeline/index.html" title='vulkano::pipeline mod'>pipeline</a></td><td class='docblock-short'><p>Describes a graphical or compute operation.</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="mod" href="query/index.html" title='vulkano::query mod'>query</a></td><td class='docblock-short'><p>This module provides support for query pools.</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="mod" href="sampler/index.html" title='vulkano::sampler mod'>sampler</a></td><td class='docblock-short'><p>How to retrieve data from an image within a shader.</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="mod" href="swapchain/index.html" title='vulkano::swapchain mod'>swapchain</a></td><td class='docblock-short'><p>Link between Vulkan and a window and/or the screen.</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="mod" href="sync/index.html" title='vulkano::sync mod'>sync</a></td><td class='docblock-short'><p>Synchronization on the GPU.</p>
|
|
|
</td></tr></table><h2 id='macros' class='section-header'><a href="#macros">Macros</a></h2>
|
|
|
<table><tr class='module-item'><td><a class="macro" href="macro.app_info_from_cargo_toml.html" title='vulkano::app_info_from_cargo_toml macro'>app_info_from_cargo_toml</a></td><td class='docblock-short'><p>Builds an <code>ApplicationInfo</code> from the information gathered by Cargo.</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="macro" href="macro.buffer_slice_field.html" title='vulkano::buffer_slice_field macro'>buffer_slice_field</a></td><td class='docblock-short'><p>Takes a <code>BufferSlice</code> that points to a struct, and returns a <code>BufferSlice</code> that points to
|
|
|
a specific field of that struct.</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="macro" href="macro.impl_vertex.html" title='vulkano::impl_vertex macro'>impl_vertex</a></td><td class='docblock-short'><p>Implements the <code>Vertex</code> trait on a struct.</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="macro" href="macro.ordered_passes_renderpass.html" title='vulkano::ordered_passes_renderpass macro'>ordered_passes_renderpass</a></td><td class='docblock-short'><p>Builds a <code>RenderPass</code> object whose template parameter is of indeterminate type.</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="macro" href="macro.single_pass_renderpass.html" title='vulkano::single_pass_renderpass macro'>single_pass_renderpass</a></td><td class='docblock-short'><p>Builds a <code>RenderPass</code> object whose template parameter is of indeterminate type.</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="macro" href="macro.statically_linked_vulkan_loader.html" title='vulkano::statically_linked_vulkan_loader macro'>statically_linked_vulkan_loader</a></td><td class='docblock-short'><p>Expression that returns a loader that assumes that Vulkan is linked to the executable you're
|
|
|
compiling.</p>
|
|
|
</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
|
|
|
<table><tr class='module-item'><td><a class="enum" href="enum.OomError.html" title='vulkano::OomError enum'>OomError</a></td><td class='docblock-short'><p>Error type returned by most Vulkan functions.</p>
|
|
|
</td></tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
|
|
|
<table><tr class='module-item'><td><a class="trait" href="trait.SafeDeref.html" title='vulkano::SafeDeref trait'>SafeDeref</a></td><td class='docblock-short'><p>Alternative to the <code>Deref</code> trait. Contrary to <code>Deref</code>, must always return the same object.</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="trait" href="trait.SynchronizedVulkanObject.html" title='vulkano::SynchronizedVulkanObject trait'>SynchronizedVulkanObject</a></td><td class='docblock-short'><p>Gives access to the internal identifier of an object.</p>
|
|
|
</td></tr><tr class='module-item'><td><a class="trait" href="trait.VulkanHandle.html" title='vulkano::VulkanHandle trait'>VulkanHandle</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="trait" href="trait.VulkanObject.html" title='vulkano::VulkanObject trait'>VulkanObject</a></td><td class='docblock-short'><p>Gives access to the internal identifier of an object.</p>
|
|
|
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "vulkano";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html> |