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
Mono/C#: WebAssembly and initial AOT support #33603
The head ref may contain hidden characters: "\u3070\u304B"
Conversation
Woah! Does this mean we can expect |
@CaptainStack That's what this pull request implements 🙂 (WebGL is just a rendering API, it has no relation with the scripting languages used to program game logic in Godot.) |
The Mono IL interpreter's WebAssembly to native trampolines don't support passing structs by value, so we need to do it this way. Also now we pass and return long, ulong, float and double as ref parameters as well. This is due to missing trampolines for float and long types. This is likely a temporary workaround that will be reverted in the future. The correct solution would be to patch 'mono/mini/m2n-gen.cs' when building the Mono runtime for WASM in order to generate the trampolines we need.
As discussed with @neikeq, this should hopefully not introduce regressions for existing desktop and Android builds, so let's merge. We likely won't ship 3.2 with AOT, but I might manage to get the WebAssembly templates in time (worked on it the past few days). AOT will be refined in master and we'll cherrypick relevant changes for a later 3.2.x release when it's ready. |
Thanks! |
Great work, I was super interested in how this was going to be done. I also really enjoyed the branch name :P. |
WebAssembly for C# is now working, although we only support the interpreter right now, which is much slower than AOT.
Initial AOT compilation support was added for other platforms. There's still more work to do here. We do not support LLVM yet (although you may experiment with that using the "Extra Aot Options" setting).
More info will come once I update the Compiling with Mono docs.
Bugsquad edit: Fixes #20270.