-
-
Notifications
You must be signed in to change notification settings - Fork 219
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
Enable experimental wasm support #493
Conversation
08c09d7
to
47aec42
Compare
API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-493 |
de7f73d
to
1fbe196
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.
This is looking awesome 🚀 🦀 !!! Months of efforts from multiple contributors seem to have paid out 😄
Thank you very much @zecozephyr for the brilliant patch. Also thanks to everyone else involved, including @Esption for the recent 32-bit improvements and general help over at the WASM Discord thread, @Bromeon for all the support throughout, and the Godot contributors for all the recent work allowing GDExtension to work on WASM. 👍
49c69e2
to
373bcea
Compare
Thanks a lot for this fantastic pull request, this is a great step towards WebAssembly support! ❤️ For future reference, I tested this PR as follows:
For me (Windows 10) it runs on Edge, but not on Firefox at the moment. That's probably something we or Godot devs need to investigate in the future. For GDScript itself, Firefox definitely works (I recently released a LD54 game for Web). Either way, I'm super happy the Dodge-the-Creeps example already works with WASM |
Regarding Firefox not working (loading forever, then freezing), I also tried with Seems to be a Godot/Emscripten issue, see also godotengine/godot-cpp#1247 (comment). |
Instead of messing around with godot export templates or emscripten in order to either: 1. dlopen the gdextension lib with global flag (which may come with unforeseen problems from broadly exposing miscellaneous new symbols from the dso). 2. Reconsider the lookup scope of `dynCall_<sig>` in the generated `invoke_<sig>` methods (i.e. when an invoke_<sig> is generated, also make it remember the originating dso and fall back to lookup in the dso exports if the `dynCall` is not found globally) I instead opt to simply promote the selected troublesome symbols from the dso to Module scope as early as possible at the gdextension entry point, whilst also searching for and executing the constructor methods which set up state for the subsequent class registrations. ----------- Tested With: Godot Engine v4.1.3.stable.official [f06b6836a] (default export templates, dlink variant) rustc 1.75.0-nightly (2f1bd0729 2023-10-27) emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.47 (431685f05c67f0424c11473cc16798b9587bb536) Chrome Version 120.0.6093.0 (Official Build) canary (arm64)
373bcea
to
816c232
Compare
Instead of messing around with godot export templates or emscripten in order to either:
dlopen the gdextension lib with global flag (which may come with unforeseen problems from broadly exposing miscellaneous new symbols from the dso).
Reconsider the lookup scope of
dynCall_<sig>
in the generatedinvoke_<sig>
methods (i.e. when an invoke_ is generated, also make it it remember the originating dso and fall back to lookup in the dso exports if thedynCall
is not found globally)I instead opt to simply promote the selected troublesome symbols from the dso to Module scope as early as possible at the gdextension entry point, whilst also searching for and executing the constructor methods which set up state for the subsequent class registrations.
Tested With:
Godot Engine v4.1.3.stable.official [f06b6836a]
(default export templates, dlink variant)
rustc 1.75.0-nightly (2f1bd0729 2023-10-27)
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.47 (431685f05c67f0424c11473cc16798b9587bb536)
Chrome Version 120.0.6093.0 (Official Build) canary (arm64)