|
243 | 243 | <a href="#242" id="242">242</a> |
244 | 244 | <a href="#243" id="243">243</a> |
245 | 245 | <a href="#244" id="244">244</a> |
246 | | -<a href="#245" id="245">245</a></pre></div><pre class="rust"><code><span class="kw">use </span>std::ops::{Deref, DerefMut}; |
| 246 | +<a href="#245" id="245">245</a> |
| 247 | +<a href="#246" id="246">246</a> |
| 248 | +<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> |
| 254 | +<a href="#253" id="253">253</a> |
| 255 | +<a href="#254" id="254">254</a></pre></div><pre class="rust"><code><span class="kw">use </span>std::ops::{Deref, DerefMut}; |
247 | 256 |
|
248 | 257 | <span class="kw">use crate</span>::<span class="kw-2">*</span>; |
249 | 258 |
|
|
354 | 363 | /// If possible, consider using [`Queue::write_buffer_with`] instead. That |
355 | 364 | /// method avoids an intermediate copy and is often able to transfer data |
356 | 365 | /// more efficiently than this one. |
| 366 | + /// |
| 367 | + /// Currently on native platforms, for both of these methods the staging |
| 368 | + /// memory will be a new allocation. This will then be released after the |
| 369 | + /// next submission finishes. To entirely avoid short-lived allocations, you might |
| 370 | + /// be able to use [`StagingBelt`](crate::util::StagingBelt). |
357 | 371 | </span><span class="kw">pub fn </span>write_buffer(<span class="kw-2">&</span><span class="self">self</span>, buffer: <span class="kw-2">&</span>Buffer, offset: BufferAddress, data: <span class="kw-2">&</span>[u8]) { |
358 | 372 | <span class="self">self</span>.inner.write_buffer(<span class="kw-2">&</span>buffer.inner, offset, data); |
359 | 373 | } |
|
386 | 400 | /// ``` |
387 | 401 | /// |
388 | 402 | /// This method fails if `size` is greater than the size of `buffer` starting at `offset`. |
| 403 | + /// |
| 404 | + /// Currently on native platforms, the staging memory will be a new allocation, which will |
| 405 | + /// then be released after the next submission finishes. To entirely avoid short-lived |
| 406 | + /// allocations, you might be able to use [`StagingBelt`](crate::util::StagingBelt). |
389 | 407 | </span><span class="attr">#[must_use] |
390 | 408 | </span><span class="kw">pub fn </span>write_buffer_with<<span class="lifetime">'a</span>>( |
391 | 409 | <span class="kw-2">&</span><span class="lifetime">'a </span><span class="self">self</span>, |
|
0 commit comments