Files
rust-gpu/api/spirv_std/float/index.html
github-merge-queue[bot] 89eb604713 Deploying to gh-pages from @ e2e4d529a5 ๐Ÿš€
2026-04-17 14:18:32 +00:00

22 lines
7.0 KiB
HTML

<!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="Traits and helper functions related to floats."><title>spirv_std::float - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-17e0aaed.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="spirv_std" data-themes="" data-resource-suffix="" data-rustdoc-version="1.96.0-nightly (02c7f9bec 2026-04-10)" data-channel="nightly" data-search-js="search-b5634cc7.js" data-stringdex-js="stringdex-2da4960a.js" data-settings-js="settings-170eb4bf.js" ><script src="../../static.files/storage-41dd4d93.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-5013f961.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-f7c3ffd8.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><a class="skip-main-content" href="#main-content">Skip to main content</a><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module float</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../spirv_std/index.html">spirv_<wbr>std</a><span class="version">0.10.0-alpha.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module float</a></h2><h3><a href="#functions">Module Items</a></h3><ul class="block"><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate spirv_<wbr>std</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content" tabindex="-1"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">spirv_std</a></div><h1>Module <span>float</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/spirv_std/float.rs.html#1-212">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Traits and helper functions related to floats.</p>
</div></details><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">ยง</a></h2><dl class="item-table"><dt><a class="fn" href="fn.f16_to_f32.html" title="fn spirv_std::float::f16_to_f32">f16_<wbr>to_<wbr>f32</a></dt><dd>Converts an f16 (half) into an f32 (float). The parameter is a u32, due to GPU support for u16
not being universal - the upper 16 bits are ignored.</dd><dt><a class="fn" href="fn.f16x2_to_vec2.html" title="fn spirv_std::float::f16x2_to_vec2">f16x2_<wbr>to_<wbr>vec2</a></dt><dd>Converts two f16 values (halfs) into two f32 values (floats). The parameter is a u32, with the
low 16 bits being the first f16, and the high 16 bits being the second f16.</dd><dt><a class="fn" href="fn.f32_to_f16.html" title="fn spirv_std::float::f32_to_f16">f32_<wbr>to_<wbr>f16</a></dt><dd>Converts an f32 (float) into an f16 (half). The result is a u32, not a u16, due to GPU support
for u16 not being universal - the upper 16 bits will always be zero.</dd><dt><a class="fn" href="fn.u8x4_to_vec4_snorm.html" title="fn spirv_std::float::u8x4_to_vec4_snorm">u8x4_<wbr>to_<wbr>vec4_<wbr>snorm</a></dt><dd>Unpacks 4 8-bit signed integers into a vec4. See
<a href="https://www.khronos.org/registry/SPIR-V/specs/1.0/GLSL.std.450.html">UnpackSnorm4x8</a> for exact
semantics.</dd><dt><a class="fn" href="fn.u8x4_to_vec4_unorm.html" title="fn spirv_std::float::u8x4_to_vec4_unorm">u8x4_<wbr>to_<wbr>vec4_<wbr>unorm</a></dt><dd>Unpacks 4 8-bit unsigned integers into a vec4. See
<a href="https://www.khronos.org/registry/SPIR-V/specs/1.0/GLSL.std.450.html">UnpackSnorm4x8</a> for exact
semantics.</dd><dt><a class="fn" href="fn.u16x2_to_vec2_snorm.html" title="fn spirv_std::float::u16x2_to_vec2_snorm">u16x2_<wbr>to_<wbr>vec2_<wbr>snorm</a></dt><dd>Unpacks 2 16-bit signed integers into a vec2. See
<a href="https://www.khronos.org/registry/SPIR-V/specs/1.0/GLSL.std.450.html">UnpackSnorm2x16</a> for
exact semantics.</dd><dt><a class="fn" href="fn.u16x2_to_vec2_unorm.html" title="fn spirv_std::float::u16x2_to_vec2_unorm">u16x2_<wbr>to_<wbr>vec2_<wbr>unorm</a></dt><dd>Unpacks 2 16-bit unsigned integers into a vec2. See
<a href="https://www.khronos.org/registry/SPIR-V/specs/1.0/GLSL.std.450.html">UnpackUnorm2x16</a> for
exact semantics.</dd><dt><a class="fn" href="fn.vec2_to_f16x2.html" title="fn spirv_std::float::vec2_to_f16x2">vec2_<wbr>to_<wbr>f16x2</a></dt><dd>Converts two f32 values (floats) into two f16 values (halfs). The result is a u32, with the low
16 bits being the first f16, and the high 16 bits being the second f16.</dd><dt><a class="fn" href="fn.vec2_to_u16x2_snorm.html" title="fn spirv_std::float::vec2_to_u16x2_snorm">vec2_<wbr>to_<wbr>u16x2_<wbr>snorm</a></dt><dd>Packs a vec2 into 2 16-bit signed integers. See
<a href="https://www.khronos.org/registry/SPIR-V/specs/1.0/GLSL.std.450.html">PackSnorm2x16</a> for exact
semantics.</dd><dt><a class="fn" href="fn.vec2_to_u16x2_unorm.html" title="fn spirv_std::float::vec2_to_u16x2_unorm">vec2_<wbr>to_<wbr>u16x2_<wbr>unorm</a></dt><dd>Packs a vec2 into 2 16-bit unsigned integers. See
<a href="https://www.khronos.org/registry/SPIR-V/specs/1.0/GLSL.std.450.html">PackUnorm2x16</a> for exact
semantics.</dd><dt><a class="fn" href="fn.vec4_to_u8x4_snorm.html" title="fn spirv_std::float::vec4_to_u8x4_snorm">vec4_<wbr>to_<wbr>u8x4_<wbr>snorm</a></dt><dd>Packs a vec4 into 4 8-bit signed integers. See
<a href="https://www.khronos.org/registry/SPIR-V/specs/1.0/GLSL.std.450.html">PackSnorm4x8</a> for exact
semantics.</dd><dt><a class="fn" href="fn.vec4_to_u8x4_unorm.html" title="fn spirv_std::float::vec4_to_u8x4_unorm">vec4_<wbr>to_<wbr>u8x4_<wbr>unorm</a></dt><dd>Packs a vec4 into 4 8-bit unsigned integers. See
<a href="https://www.khronos.org/registry/SPIR-V/specs/1.0/GLSL.std.450.html">PackUnorm4x8</a> for exact
semantics.</dd></dl></section></div></main></body></html>