mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-21 22:33:49 +00:00
Clarify cfg(send_sync) gating in this backend/webgpu comment. (#6274)
Addresses the confusion in #6267.
This commit is contained in:
parent
eb18854b46
commit
a21c0e2696
@ -26,9 +26,10 @@ use crate::{
|
|||||||
// implement `Send` and `Sync` to match native.
|
// implement `Send` and `Sync` to match native.
|
||||||
//
|
//
|
||||||
// SAFETY: All webgpu handle types in wasm32 are internally a `JsValue`, and `JsValue` is neither
|
// SAFETY: All webgpu handle types in wasm32 are internally a `JsValue`, and `JsValue` is neither
|
||||||
// Send nor Sync. Currently, wasm32 has no threading support so implementing `Send` or `Sync` for a
|
// Send nor Sync. Currently, wasm32 has no threading support by default, so implementing `Send` or
|
||||||
// type is (for now) harmless. Eventually wasm32 will support threading, and depending on how this
|
// `Sync` for a type is harmless. However, nightly Rust supports compiling wasm with experimental
|
||||||
// is integrated (or not integrated) with values like those in webgpu, this may become unsound.
|
// threading support via `--target-features`. If `wgpu` is being compiled with those features, we do
|
||||||
|
// not implement `Send` and `Sync` on the webgpu handle types.
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub(crate) struct Sendable<T>(T);
|
pub(crate) struct Sendable<T>(T);
|
||||||
|
Loading…
Reference in New Issue
Block a user