-
Notifications
You must be signed in to change notification settings - Fork 12
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
Wasm global imports #13
Comments
|
What is this? |
@fire Added some more context to the ticket. Essentially, there is a bit of a technical limitation re: implementing mutable global imports. Below is my understanding of Wasm import globals and may not be wholly accurate. Modules can accept mutable global imports. These are basically treated as a pseudo-import-memory. When the module mutates the global import, it writes the value to this address (actually handled by the runtime which writes the value to a pointer). My intent for global imports was to accept the from GDScript the same as import functions i.e. target and method in the case of functions and target and property in the case of globals. I anticipated passing these in along side functions which is why there is an import dictionary passed to
Here, the GDScript instantiating the module ( Note that more functionality around globals is totally possible today without any rethinking but I've deferred until coming up with a plan to support globals completely (including the case mentioned above). Happy to hear any ideas. |
This ticket captures making Wasm module global imports accessible to GDScript via Godot Wasm. The following specs give some info regarding Wasm module global.
Wasm mutable global spec
MDN JS reference
At the time of writing (v0.2.2), the following global functionality exists.
A property of a GDScript script should be able to be imported as a global and read by a Wasm module. Because GDScript properties can not be read or written using the Wasm C API's expected pointer interface, global setters and getters are required. This precludes using the C API and requires the C++ API instead. Using the C++ API is blocked by wasmerio/wasmer#3754.
The text was updated successfully, but these errors were encountered: