1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 14:20:04 -04:00

Add opt-out fragile-send-sync-non-atomic-wasm feature for wgpu (#5098)

Note this will break people depending on eframe or egui-wgpu with
--no-default-features.
I don't know what to do about that to be honest.

* Closes #4914 
* [x] I have followed the instructions in the PR template

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
This commit is contained in:
9SMTM6
2024-09-13 13:00:18 +02:00
committed by GitHub
parent f658f8b02b
commit 08f5eb30a4
6 changed files with 53 additions and 6 deletions

View File

@@ -31,7 +31,7 @@ all-features = true
rustdoc-args = ["--generate-link-to-definition"]
[features]
default = []
default = ["fragile-send-sync-non-atomic-wasm"]
## Enable profiling with the [`puffin`](https://docs.rs/puffin) crate.
puffin = ["dep:puffin"]
@@ -45,6 +45,12 @@ wayland = ["winit?/wayland"]
## Enables x11 support for winit.
x11 = ["winit?/x11"]
## Make the renderer `Sync` on wasm, exploiting that by default wasm isn't multithreaded.
## It may make code easier, expecially when targeting both native and web.
## On native most wgpu objects are send and sync, on the web they are not (by nature of the WebGPU specification).
## This is not supported in [multithreaded WASM](https://gpuweb.github.io/gpuweb/explainer/#multithreading-transfer).
## Thus that usage is guarded against with compiler errors in wgpu.
fragile-send-sync-non-atomic-wasm = ["wgpu/fragile-send-sync-non-atomic-wasm"]
[dependencies]
egui = { workspace = true, default-features = false }