Skip to content

Commit 4efc0bd

Browse files
committed
Deploying to master from @ gfx-rs/wgpu@03ff99e 🚀
1 parent 0b20d91 commit 4efc0bd

File tree

111 files changed

+876
-608
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+876
-608
lines changed

doc/search-index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/src/wgpu/api/adapter.rs.html

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,14 @@
195195
<a href="#194" id="194">194</a>
196196
<a href="#195" id="195">195</a>
197197
<a href="#196" id="196">196</a>
198-
</pre></div><pre class="rust"><code><span class="kw">use </span>std::future::Future;
198+
<a href="#197" id="197">197</a>
199+
<a href="#198" id="198">198</a>
200+
<a href="#199" id="199">199</a>
201+
<a href="#200" id="200">200</a>
202+
<a href="#201" id="201">201</a>
203+
<a href="#202" id="202">202</a>
204+
<a href="#203" id="203">203</a>
205+
</pre></div><pre class="rust"><code><span class="kw">use </span>std::{future::Future, sync::Arc};
199206

200207
<span class="kw">use crate</span>::<span class="kw-2">*</span>;
201208

@@ -210,9 +217,9 @@
210217
/// Does not have to be kept alive.
211218
///
212219
/// Corresponds to [WebGPU `GPUAdapter`](https://gpuweb.github.io/gpuweb/#gpu-adapter).
213-
</span><span class="attr">#[derive(Debug)]
220+
</span><span class="attr">#[derive(Debug, Clone)]
214221
</span><span class="kw">pub struct </span>Adapter {
215-
<span class="kw">pub</span>(<span class="kw">crate</span>) inner: dispatch::DispatchAdapter,
222+
<span class="kw">pub</span>(<span class="kw">crate</span>) inner: Arc&lt;dispatch::DispatchAdapter&gt;,
216223
}
217224
<span class="attr">#[cfg(send_sync)]
218225
</span><span class="macro">static_assertions::assert_impl_all!</span>(Adapter: Send, Sync);
@@ -262,9 +269,16 @@
262269
) -&gt; <span class="kw">impl </span>Future&lt;Output = <span class="prelude-ty">Result</span>&lt;(Device, Queue), RequestDeviceError&gt;&gt; + WasmNotSend {
263270
<span class="kw">let </span>device = <span class="self">self</span>.inner.request_device(desc, trace_path);
264271
<span class="kw">async move </span>{
265-
device
266-
.<span class="kw">await
267-
</span>.map(|(device, queue)| (Device { inner: device }, Queue { inner: queue }))
272+
device.<span class="kw">await</span>.map(|(device, queue)| {
273+
(
274+
Device {
275+
inner: Arc::new(device),
276+
},
277+
Queue {
278+
inner: Arc::new(queue),
279+
},
280+
)
281+
})
268282
}
269283
}
270284

@@ -290,10 +304,10 @@
290304

291305
<span class="prelude-val">Ok</span>((
292306
Device {
293-
inner: device.into(),
307+
inner: Arc::new(device.into()),
294308
},
295309
Queue {
296-
inner: queue.into(),
310+
inner: Arc::new(queue.into()),
297311
},
298312
))
299313
}

doc/src/wgpu/api/bind_group.rs.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,11 @@
141141
<a href="#140" id="140">140</a>
142142
<a href="#141" id="141">141</a>
143143
<a href="#142" id="142">142</a>
144-
</pre></div><pre class="rust"><code><span class="kw">use crate</span>::<span class="kw-2">*</span>;
144+
<a href="#143" id="143">143</a>
145+
<a href="#144" id="144">144</a>
146+
</pre></div><pre class="rust"><code><span class="kw">use </span>std::sync::Arc;
147+
148+
<span class="kw">use crate</span>::<span class="kw-2">*</span>;
145149

146150
<span class="doccomment">/// Handle to a binding group.
147151
///
@@ -151,9 +155,9 @@
151155
/// [`ComputePass`] with [`ComputePass::set_bind_group`].
152156
///
153157
/// Corresponds to [WebGPU `GPUBindGroup`](https://gpuweb.github.io/gpuweb/#gpubindgroup).
154-
</span><span class="attr">#[derive(Debug)]
158+
</span><span class="attr">#[derive(Debug, Clone)]
155159
</span><span class="kw">pub struct </span>BindGroup {
156-
<span class="kw">pub</span>(<span class="kw">crate</span>) inner: dispatch::DispatchBindGroup,
160+
<span class="kw">pub</span>(<span class="kw">crate</span>) inner: Arc&lt;dispatch::DispatchBindGroup&gt;,
157161
}
158162
<span class="attr">#[cfg(send_sync)]
159163
</span><span class="macro">static_assertions::assert_impl_all!</span>(BindGroup: Send, Sync);

doc/src/wgpu/api/bind_group_layout.rs.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@
3636
<a href="#35" id="35">35</a>
3737
<a href="#36" id="36">36</a>
3838
<a href="#37" id="37">37</a>
39-
</pre></div><pre class="rust"><code><span class="kw">use crate</span>::<span class="kw-2">*</span>;
39+
<a href="#38" id="38">38</a>
40+
<a href="#39" id="39">39</a>
41+
</pre></div><pre class="rust"><code><span class="kw">use </span>std::sync::Arc;
42+
43+
<span class="kw">use crate</span>::<span class="kw-2">*</span>;
4044

4145
<span class="doccomment">/// Handle to a binding group layout.
4246
///
@@ -49,9 +53,9 @@
4953
///
5054
/// Corresponds to [WebGPU `GPUBindGroupLayout`](
5155
/// https://gpuweb.github.io/gpuweb/#gpubindgrouplayout).
52-
</span><span class="attr">#[derive(Debug)]
56+
</span><span class="attr">#[derive(Debug, Clone)]
5357
</span><span class="kw">pub struct </span>BindGroupLayout {
54-
<span class="kw">pub</span>(<span class="kw">crate</span>) inner: dispatch::DispatchBindGroupLayout,
58+
<span class="kw">pub</span>(<span class="kw">crate</span>) inner: Arc&lt;dispatch::DispatchBindGroupLayout&gt;,
5559
}
5660
<span class="attr">#[cfg(send_sync)]
5761
</span><span class="macro">static_assertions::assert_impl_all!</span>(BindGroupLayout: Send, Sync);

doc/src/wgpu/api/blas.rs.html

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,6 @@
181181
<a href="#180" id="180">180</a>
182182
<a href="#181" id="181">181</a>
183183
<a href="#182" id="182">182</a>
184-
<a href="#183" id="183">183</a>
185-
<a href="#184" id="184">184</a>
186-
<a href="#185" id="185">185</a>
187-
<a href="#186" id="186">186</a>
188-
<a href="#187" id="187">187</a>
189-
<a href="#188" id="188">188</a>
190184
</pre></div><pre class="rust"><code><span class="kw">use </span><span class="kw">crate</span>::dispatch;
191185
<span class="kw">use crate</span>::{Buffer, Label};
192186
<span class="kw">use </span>std::sync::Arc;
@@ -233,7 +227,7 @@
233227
/// [TlasPackage]: crate::TlasPackage
234228
</span><span class="attr">#[derive(Debug, Clone)]
235229
</span><span class="kw">pub struct </span>TlasInstance {
236-
<span class="kw">pub</span>(<span class="kw">crate</span>) blas: Arc&lt;BlasShared&gt;,
230+
<span class="kw">pub</span>(<span class="kw">crate</span>) blas: Arc&lt;dispatch::DispatchBlas&gt;,
237231
<span class="doccomment">/// Affine transform matrix 3x4 (rows x columns, row major order).
238232
</span><span class="kw">pub </span>transform: [f32; <span class="number">12</span>],
239233
<span class="doccomment">/// Custom index for the instance used inside the shader.
@@ -260,7 +254,7 @@
260254
/// generate a validation error.
261255
</span><span class="kw">pub fn </span>new(blas: <span class="kw-2">&amp;</span>Blas, transform: [f32; <span class="number">12</span>], custom_index: u32, mask: u8) -&gt; <span class="self">Self </span>{
262256
<span class="self">Self </span>{
263-
blas: blas.shared.clone(),
257+
blas: blas.inner.clone(),
264258
transform,
265259
custom_index,
266260
mask,
@@ -272,7 +266,7 @@
272266
/// See the note on [TlasInstance] about the
273267
/// guarantees of keeping a BLAS alive.
274268
</span><span class="kw">pub fn </span>set_blas(<span class="kw-2">&amp;mut </span><span class="self">self</span>, blas: <span class="kw-2">&amp;</span>Blas) {
275-
<span class="self">self</span>.blas = blas.shared.clone();
269+
<span class="self">self</span>.blas = blas.inner.clone();
276270
}
277271
}
278272

@@ -317,13 +311,7 @@
317311
}
318312
<span class="macro">static_assertions::assert_impl_all!</span>(BlasBuildEntry&lt;<span class="lifetime">'_</span>&gt;: WasmNotSendSync);
319313

320-
<span class="attr">#[derive(Debug)]
321-
</span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">struct </span>BlasShared {
322-
<span class="kw">pub</span>(<span class="kw">crate</span>) inner: dispatch::DispatchBlas,
323-
}
324-
<span class="macro">static_assertions::assert_impl_all!</span>(BlasShared: WasmNotSendSync);
325-
326-
<span class="attr">#[derive(Debug)]
314+
<span class="attr">#[derive(Debug, Clone)]
327315
</span><span class="doccomment">/// Bottom Level Acceleration Structure (BLAS).
328316
///
329317
/// A BLAS is a device-specific raytracing acceleration structure that contains geometry data.
@@ -333,11 +321,11 @@
333321
/// [Tlas]: crate::Tlas
334322
</span><span class="kw">pub struct </span>Blas {
335323
<span class="kw">pub</span>(<span class="kw">crate</span>) handle: <span class="prelude-ty">Option</span>&lt;u64&gt;,
336-
<span class="kw">pub</span>(<span class="kw">crate</span>) shared: Arc&lt;BlasShared&gt;,
324+
<span class="kw">pub</span>(<span class="kw">crate</span>) inner: Arc&lt;dispatch::DispatchBlas&gt;,
337325
}
338326
<span class="macro">static_assertions::assert_impl_all!</span>(Blas: WasmNotSendSync);
339327

340-
<span class="macro">crate::cmp::impl_eq_ord_hash_proxy!</span>(Blas =&gt; .shared.inner);
328+
<span class="macro">crate::cmp::impl_eq_ord_hash_proxy!</span>(Blas =&gt; .inner);
341329

342330
<span class="kw">impl </span>Blas {
343331
<span class="doccomment">/// Raw handle to the acceleration structure, used inside raw instance buffers.
@@ -346,7 +334,7 @@
346334
}
347335
<span class="doccomment">/// Destroy the associated native resources as soon as possible.
348336
</span><span class="kw">pub fn </span>destroy(<span class="kw-2">&amp;</span><span class="self">self</span>) {
349-
<span class="self">self</span>.shared.inner.destroy();
337+
<span class="self">self</span>.inner.destroy();
350338
}
351339
}
352340

0 commit comments

Comments
 (0)