Skip to content

WASM renderer isn't thread safe #9304

Closed
@Elabajaba

Description

@Elabajaba

Bevy version

0.12 dev + wgpu 0.17

What went wrong

Wgpu types have been pretending to be Send + Sync on wasm despite being !Send + !Sync as it assumed wasm threading wasn't a thing, and it made using wpgu for native and wasm significantly easier.

Wasm threads are now starting to be used elsewhere, so wgpu has now changed it so that the types are still Send + Sync on native, but are now !Send + !Sync on wasm meaning that the renderer is now full of panics when targeting wasm because we're using #[derive(Resource)] on types that are !Send + !Sync

Additional information

See https://github.com/gfx-rs/wgpu/blob/trunk/CHANGELOG.md#wgpu-types-now-send-sync-on-wasm and gfx-rs/wgpu#3691

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-BugAn unexpected or incorrect behaviorO-WebSpecific to web (WASM) buildsP-HighThis is particularly urgent, and deserves immediate attentionP-UnsoundA bug that results in undefined compiler behavior

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions