-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial support for running compositor_render
on web
#683
Conversation
74ac1fa
to
a4abd45
Compare
schemars = { git = "https://github.com/membraneframework-labs/schemars", rev = "a5ad1f9", features = [ | ||
"preserve_order", | ||
] } | ||
shared_memory = "0.12.4" | ||
wgpu = { version = "0.19.1", default-features = false, features = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are you actually changing here, is this disabling some default features, if so which?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default wgpu
has webgpu
feature enabled which has higher priority than webgl
feature. Currently, compositor does not run on webgpu
due to lack of support for push constants on webgpu
(they are not emulated like on webgl
)
Edit:
Technically, chrome supports push constants on webgpu but it's experimental and needs a special flag enabled. I'm not sure about Firefox
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I added fragile-send-sync-non-atomic-wasm
feature, which makes the wgpu types Send
(by default they are not Send
and Sync
on wasm). This feature is slightly unsafe because on wasm those types should not be shared between threads and it removes the compile time checks.
But, since we target web browsers which run the app on single thread it should not be problem for us. LayoutProvider
needs to be Send
because compositor_pipeline
uses threads. We could also solve it by making 2 LayoutProvider
s (one Send and the other one non-Send) and enabling one based on #[cfg(target_arch = "wasm32")]
.
I decided to use the first approach with adding the feature because it was just the easier way
921cea1
to
1c05a8d
Compare
1c05a8d
to
5cdf8b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend rethinking file structure. e.g.
- you have utils file that only contains stuff related to wgpu
- you have app module that seems to sth top level, but it is only used in utils package
Do not merge everything into this branch, if this is ready then merge it to master |
Issue: #653