You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Trac3r-rust/doc/vulkano/format/index.html

107 lines
46 KiB

5 years ago
<!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 `format` mod in crate `vulkano`."><meta name="keywords" content="rust, rustlang, rust-lang, format"><title>vulkano::format - 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">&#9776;</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'>Module format</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li></ul></div><p class='location'><a href='../index.html'>vulkano</a></p><script>window.sidebarCurrent = {name: 'format', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></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'>&#x2212;</span>]</a></span><a class='srclink' href='../../src/vulkano/format.rs.html#10-970' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>vulkano</a>::<wbr><a class="mod" href=''>format</a></span></h1><div class='docblock'><p>Declares all the formats of data and images supported by Vulkan.</p>
<h1 id="content-of-this-module" class="section-header"><a href="#content-of-this-module">Content of this module</a></h1>
<p>This module contains three things:</p>
<ul>
<li>The <code>Format</code> enumeration, which contains all the available formats.</li>
<li>The <code>FormatDesc</code> trait.</li>
<li>One struct for each format.</li>
</ul>
<h1 id="formats" class="section-header"><a href="#formats">Formats</a></h1>
<p>List of suffixes:</p>
<ul>
<li>
<p><code>Unorm</code> means that the values are unsigned integers that are converted into floating points.
The maximum possible representable value becomes <code>1.0</code>, and the minimum representable value
becomes <code>0.0</code>. For example the value <code>255</code> in a <code>R8Unorm</code> will be interpreted as <code>1.0</code>.</p>
</li>
<li>
<p><code>Snorm</code> is the same as <code>Unorm</code>, but the integers are signed and the range is from <code>-1.0</code> to
<code>1.0</code> instead.</p>
</li>
<li>
<p><code>Uscaled</code> means that the values are unsigned integers that are converted into floating points.
No change in the value is done. For example the value <code>255</code> in a <code>R8Uscaled</code> will be
interpreted as <code>255.0</code>.</p>
</li>
<li>
<p><code>Sscaled</code> is the same as <code>Uscaled</code> expect that the integers are signed.</p>
</li>
<li>
<p><code>Uint</code> means that the values are unsigned integers. No conversion is performed.</p>
</li>
<li>
<p><code>Sint</code> means that the values are signed integers. No conversion is performed.</p>
</li>
<li>
<p><code>Ufloat</code> means that the values are unsigned floating points. No conversion is performed. This
format is very unusual.</p>
</li>
<li>
<p><code>Sfloat</code> means that the values are regular floating points. No conversion is performed.</p>
</li>
<li>
<p><code>Srgb</code> is the same as <code>Unorm</code>, except that the value is interpreted as being in the sRGB
color space. This means that its value will be converted to fit in the RGB color space when
it is read. The fourth channel (usually used for alpha), if present, is not concerned by the
conversion.</p>
</li>
</ul>
<h1 id="choosing-a-format" class="section-header"><a href="#choosing-a-format">Choosing a format</a></h1>
<p>The following formats are guaranteed to be supported for everything that is related to
texturing (ie. blitting source and sampling them linearly). You should choose one of these
formats if you have an image that you are going to sample from:</p>
<p>// TODO: use vulkano enums</p>
<ul>
<li>B4G4R4A4_UNORM_PACK16</li>
<li>R5G6B5_UNORM_PACK16</li>
<li>A1R5G5B5_UNORM_PACK16</li>
<li>R8_UNORM</li>
<li>R8_SNORM</li>
<li>R8G8_UNORM</li>
<li>R8G8_SNORM</li>
<li>R8G8B8A8_UNORM</li>
<li>R8G8B8A8_SNORM</li>
<li>R8G8B8A8_SRGB</li>
<li>B8G8R8A8_UNORM</li>
<li>B8G8R8A8_SRGB</li>
<li>A8B8G8R8_UNORM_PACK32</li>
<li>A8B8G8R8_SNORM_PACK32</li>
<li>A8B8G8R8_SRGB_PACK32</li>
<li>A2B10G10R10_UNORM_PACK32</li>
<li>R16_SFLOAT</li>
<li>R16G16_SFLOAT</li>
<li>R16G16B16A16_SFLOAT</li>
<li>B10G11R11_UFLOAT_PACK32</li>
<li>E5B9G9R9_UFLOAT_PACK32</li>
</ul>
<p>The following formats are guaranteed to be supported for everything that is related to
intermediate render targets (ie. blitting destination, color attachment and sampling linearly):</p>
<p>// TODO: use vulkano enums</p>
<ul>
<li>R5G6B5_UNORM_PACK16</li>
<li>A1R5G5B5_UNORM_PACK16</li>
<li>R8_UNORM</li>
<li>R8G8_UNORM</li>
<li>R8G8B8A8_UNORM</li>
<li>R8G8B8A8_SRGB</li>
<li>B8G8R8A8_UNORM</li>
<li>B8G8R8A8_SRGB</li>
<li>A8B8G8R8_UNORM_PACK32</li>
<li>A8B8G8R8_SRGB_PACK32</li>
<li>A2B10G10R10_UNORM_PACK32</li>
<li>R16_SFLOAT</li>
<li>R16G16_SFLOAT</li>
<li>R16G16B16A16_SFLOAT</li>
</ul>
<p>For depth images, only <code>D16Unorm</code> is guaranteed to be supported. For depth-stencil images,
it is guaranteed that either <code>D24Unorm_S8Uint</code> or <code>D32Sfloat_S8Uint</code> are supported.</p>
<p>// TODO: storage formats</p>
</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
<table><tr class='module-item'><td><a class="struct" href="struct.A1R5G5B5UnormPack16.html" title='vulkano::format::A1R5G5B5UnormPack16 struct'>A1R5G5B5UnormPack16</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.A2B10G10R10SintPack32.html" title='vulkano::format::A2B10G10R10SintPack32 struct'>A2B10G10R10SintPack32</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.A2B10G10R10SnormPack32.html" title='vulkano::format::A2B10G10R10SnormPack32 struct'>A2B10G10R10SnormPack32</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.A2B10G10R10SscaledPack32.html" title='vulkano::format::A2B10G10R10SscaledPack32 struct'>A2B10G10R10SscaledPack32</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.A2B10G10R10UintPack32.html" title='vulkano::format::A2B10G10R10UintPack32 struct'>A2B10G10R10UintPack32</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.A2B10G10R10UnormPack32.html" title='vulkano::format::A2B10G10R10UnormPack32 struct'>A2B10G10R10UnormPack32</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.A2B10G10R10UscaledPack32.html" title='vulkano::format::A2B10G10R10UscaledPack32 struct'>A2B10G10R10UscaledPack32</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.A2R10G10B10SintPack32.html" title='vulkano::format::A2R10G10B10SintPack32 struct'>A2R10G10B10SintPack32</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.A2R10G10B10SnormPack32.html" title='vulkano::format::A2R10G10B10SnormPack32 struct'>A2R10G10B10SnormPack32</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.A2R10G10B10SscaledPack32.html" title='vulkano::format::A2R10G10B10SscaledPack32 struct'>A2R10G10B10SscaledPack32</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.A2R10G10B10UintPack32.html" title='vulkano::format::A2R10G10B10UintPack32 struct'>A2R10G10B10UintPack32</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.A2R10G10B10UnormPack32.html" title='vulkano::format::A2R10G10B10UnormPack32 struct'>A2R10G10B10UnormPack32</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.A2R10G10B10UscaledPack32.html" title='vulkano::format::A2R10G10B10UscaledPack32 struct'>A2R10G10B10UscaledPack32</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.A8B8G8R8SintPack32.html" title='vulkano::format::A8B8G8R8SintPack32 struct'>A8B8G8R8SintPack32</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.A8B8G8R8SnormPack32.html" title='vulkano::format::A8B8G8R8SnormPack32 struct'>A8B8G8R8SnormPack32</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.A8B8G8R8SrgbPack32.html" title='vulkano::format::A8B8G8R8SrgbPack32 struct'>A8B8G8R8SrgbPack32</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.A8B8G8R8SscaledPack32.html" title='vulkano::format::A8B8G8R8SscaledPack32 struct'>A8B8G8R8SscaledPack32</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.A8B8G8R8UintPack32.html" title='vulkano::format::A8B8G8R8UintPack32 struct'>A8B8G8R8UintPack32</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.A8B8G8R8UnormPack32.html" title='vulkano::format::A8B8G8R8UnormPack32 struct'>A8B8G8R8UnormPack32</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.A8B8G8R8UscaledPack32.html" title='vulkano::format::A8B8G8R8UscaledPack32
<table><tr class='module-item'><td><a class="enum" href="enum.ClearValue.html" title='vulkano::format::ClearValue enum'>ClearValue</a></td><td class='docblock-short'><p>Describes a uniform value that will be used to fill an image.</p>
</td></tr><tr class='module-item'><td><a class="enum" href="enum.Format.html" title='vulkano::format::Format enum'>Format</a></td><td class='docblock-short'><p>An enumeration of all the possible formats.</p>
</td></tr><tr class='module-item'><td><a class="enum" href="enum.FormatTy.html" title='vulkano::format::FormatTy enum'>FormatTy</a></td><td class='docblock-short'></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.AcceptsPixels.html" title='vulkano::format::AcceptsPixels trait'>AcceptsPixels</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="trait" href="trait.ClearValuesTuple.html" title='vulkano::format::ClearValuesTuple trait'>ClearValuesTuple</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="trait" href="trait.Data.html" title='vulkano::format::Data trait'>Data</a></td><td class='docblock-short'><p>Some data whose type must be known by the library.</p>
</td></tr><tr class='module-item'><td><a class="trait" href="trait.FormatDesc.html" title='vulkano::format::FormatDesc trait'>FormatDesc</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="trait" href="trait.PossibleCompressedFormatDesc.html" title='vulkano::format::PossibleCompressedFormatDesc trait'>PossibleCompressedFormatDesc</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="trait" href="trait.PossibleDepthFormatDesc.html" title='vulkano::format::PossibleDepthFormatDesc trait'>PossibleDepthFormatDesc</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="trait" href="trait.PossibleDepthStencilFormatDesc.html" title='vulkano::format::PossibleDepthStencilFormatDesc trait'>PossibleDepthStencilFormatDesc</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="trait" href="trait.PossibleFloatFormatDesc.html" title='vulkano::format::PossibleFloatFormatDesc trait'>PossibleFloatFormatDesc</a></td><td class='docblock-short'><p>Trait for types that can possibly describe a float attachment.</p>
</td></tr><tr class='module-item'><td><a class="trait" href="trait.PossibleFloatOrCompressedFormatDesc.html" title='vulkano::format::PossibleFloatOrCompressedFormatDesc trait'>PossibleFloatOrCompressedFormatDesc</a></td><td class='docblock-short'><p>Trait for types that can possibly describe a float or compressed attachment.</p>
</td></tr><tr class='module-item'><td><a class="trait" href="trait.PossibleSintFormatDesc.html" title='vulkano::format::PossibleSintFormatDesc trait'>PossibleSintFormatDesc</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="trait" href="trait.PossibleStencilFormatDesc.html" title='vulkano::format::PossibleStencilFormatDesc trait'>PossibleStencilFormatDesc</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="trait" href="trait.PossibleUintFormatDesc.html" title='vulkano::format::PossibleUintFormatDesc trait'>PossibleUintFormatDesc</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="trait" href="trait.StrongStorage.html" title='vulkano::format::StrongStorage trait'>StrongStorage</a></td><td class='docblock-short'></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>&#9166;</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>