Skip to content

Commit 9c7be9d

Browse files
Deploying to master from @ gfx-rs/wgpu@77763b1 🚀
1 parent b427a01 commit 9c7be9d

File tree

11 files changed

+17
-26
lines changed

11 files changed

+17
-26
lines changed

doc/search-index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/src/wgpu_examples/repeated_compute/mod.rs.html

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -246,26 +246,24 @@
246246
<a href="#245" id="245">245</a>
247247
<a href="#246" id="246">246</a>
248248
<a href="#247" id="247">247</a>
249-
<a href="#248" id="248">248</a>
250-
<a href="#249" id="249">249</a>
251-
<a href="#250" id="250">250</a>
252-
<a href="#251" id="251">251</a>
253-
<a href="#252" id="252">252</a></pre></div><pre class="rust"><code><span class="doccomment">//! See hello-compute example main.rs for more details
249+
<a href="#248" id="248">248</a></pre></div><pre class="rust"><code><span class="doccomment">//! See hello-compute example main.rs for more details
254250
//! as similar items here are not explained.
255251
//!
256252
//! This example does elaborate on some things though that the
257253
//! hello-compute example does not such as mapping buffers
258254
//! and why use the async channels.
259255

260-
</span><span class="kw">const </span>OVERFLOW: u32 = <span class="number">0xffffffff</span>;
256+
</span><span class="kw">use </span>nanorand::Rng;
257+
258+
<span class="kw">const </span>OVERFLOW: u32 = <span class="number">0xffffffff</span>;
261259

262260
<span class="kw">async fn </span>run() {
263261
<span class="kw">let </span><span class="kw-2">mut </span>numbers = [<span class="number">0u32</span>; <span class="number">256</span>];
264262
<span class="kw">let </span>context = WgpuContext::new(size_of_val(<span class="kw-2">&amp;</span>numbers)).<span class="kw">await</span>;
265263

266264
<span class="kw">for _ in </span><span class="number">0</span>..<span class="number">10 </span>{
267265
<span class="kw">for </span>p <span class="kw">in </span>numbers.iter_mut() {
268-
<span class="kw-2">*</span>p = generate_rand() <span class="kw">as </span>u32;
266+
<span class="kw-2">*</span>p = nanorand::tls_rng().generate::&lt;u16&gt;() <span class="kw">as </span>u32;
269267
}
270268

271269
compute(<span class="kw-2">&amp;mut </span>numbers, <span class="kw-2">&amp;</span>context).<span class="kw">await</span>;
@@ -281,12 +279,6 @@
281279
}
282280
}
283281

284-
<span class="kw">fn </span>generate_rand() -&gt; u16 {
285-
<span class="kw">let </span><span class="kw-2">mut </span>bytes = [<span class="number">0u8</span>; <span class="number">2</span>];
286-
getrandom::getrandom(<span class="kw-2">&amp;mut </span>bytes[..]).unwrap();
287-
u16::from_le_bytes(bytes)
288-
}
289-
290282
<span class="kw">async fn </span>compute(local_buffer: <span class="kw-2">&amp;mut </span>[u32], context: <span class="kw-2">&amp;</span>WgpuContext) {
291283
<span class="macro">log::info!</span>(<span class="string">"Beginning GPU compute on data {local_buffer:?}."</span>);
292284
<span class="comment">// Local buffer contents -&gt; GPU storage buffer

doc/wgpu_examples/all.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!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 `OVERFLOW` constant in crate `wgpu_examples`."><title>OVERFLOW in wgpu_examples::repeated_compute - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-b0742ba02757f159.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="wgpu_examples" data-themes="" data-resource-suffix="" data-rustdoc-version="1.83.0 (90b35a623 2024-11-26)" data-channel="1.83.0" data-search-js="search-f0d225181b97f9a4.js" data-settings-js="settings-805db61a62df4bd2.js" ><script src="../../static.files/storage-1d39b6787ed640ff.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-f070b9041d14864c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-0111fcff984fae8f.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../wgpu_examples/index.html">wgpu_<wbr>examples</a><span class="version">24.0.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In wgpu_<wbr>examples::<wbr>repeated_<wbr>compute</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">wgpu_examples</a>::<wbr><a href="index.html">repeated_compute</a></span><h1>Constant <span class="constant">OVERFLOW</span><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/wgpu_examples/repeated_compute/mod.rs.html#8">source</a> </span></div><pre class="rust item-decl"><code>const OVERFLOW: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.u32.html">u32</a> = 0xffffffff;</code></pre></section></div></main></body></html>
1+
<!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 `OVERFLOW` constant in crate `wgpu_examples`."><title>OVERFLOW in wgpu_examples::repeated_compute - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-b0742ba02757f159.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="wgpu_examples" data-themes="" data-resource-suffix="" data-rustdoc-version="1.83.0 (90b35a623 2024-11-26)" data-channel="1.83.0" data-search-js="search-f0d225181b97f9a4.js" data-settings-js="settings-805db61a62df4bd2.js" ><script src="../../static.files/storage-1d39b6787ed640ff.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-f070b9041d14864c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-0111fcff984fae8f.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../wgpu_examples/index.html">wgpu_<wbr>examples</a><span class="version">24.0.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In wgpu_<wbr>examples::<wbr>repeated_<wbr>compute</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">wgpu_examples</a>::<wbr><a href="index.html">repeated_compute</a></span><h1>Constant <span class="constant">OVERFLOW</span><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/wgpu_examples/repeated_compute/mod.rs.html#10">source</a> </span></div><pre class="rust item-decl"><code>const OVERFLOW: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.u32.html">u32</a> = 0xffffffff;</code></pre></section></div></main></body></html>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!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 `compute` fn in crate `wgpu_examples`."><title>compute in wgpu_examples::repeated_compute - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-b0742ba02757f159.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="wgpu_examples" data-themes="" data-resource-suffix="" data-rustdoc-version="1.83.0 (90b35a623 2024-11-26)" data-channel="1.83.0" data-search-js="search-f0d225181b97f9a4.js" data-settings-js="settings-805db61a62df4bd2.js" ><script src="../../static.files/storage-1d39b6787ed640ff.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-f070b9041d14864c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-0111fcff984fae8f.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../wgpu_examples/index.html">wgpu_<wbr>examples</a><span class="version">24.0.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In wgpu_<wbr>examples::<wbr>repeated_<wbr>compute</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">wgpu_examples</a>::<wbr><a href="index.html">repeated_compute</a></span><h1>Function <span class="fn">compute</span><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/wgpu_examples/repeated_compute/mod.rs.html#38-125">source</a> </span></div><pre class="rust item-decl"><code>async fn compute(local_buffer: &amp;mut [<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.u32.html">u32</a>], context: &amp;<a class="struct" href="struct.WgpuContext.html" title="struct wgpu_examples::repeated_compute::WgpuContext">WgpuContext</a>)</code></pre></section></div></main></body></html>
1+
<!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 `compute` fn in crate `wgpu_examples`."><title>compute in wgpu_examples::repeated_compute - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-b0742ba02757f159.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="wgpu_examples" data-themes="" data-resource-suffix="" data-rustdoc-version="1.83.0 (90b35a623 2024-11-26)" data-channel="1.83.0" data-search-js="search-f0d225181b97f9a4.js" data-settings-js="settings-805db61a62df4bd2.js" ><script src="../../static.files/storage-1d39b6787ed640ff.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-f070b9041d14864c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-0111fcff984fae8f.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../wgpu_examples/index.html">wgpu_<wbr>examples</a><span class="version">24.0.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In wgpu_<wbr>examples::<wbr>repeated_<wbr>compute</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">wgpu_examples</a>::<wbr><a href="index.html">repeated_compute</a></span><h1>Function <span class="fn">compute</span><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/wgpu_examples/repeated_compute/mod.rs.html#34-121">source</a> </span></div><pre class="rust item-decl"><code>async fn compute(local_buffer: &amp;mut [<a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.u32.html">u32</a>], context: &amp;<a class="struct" href="struct.WgpuContext.html" title="struct wgpu_examples::repeated_compute::WgpuContext">WgpuContext</a>)</code></pre></section></div></main></body></html>

doc/wgpu_examples/repeated_compute/fn.generate_rand.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)