-
Notifications
You must be signed in to change notification settings - Fork 196
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
Set TOTAL_MEMORY for WASM version #92
Comments
We compile with MODULARIZE here, so it doesn't see the Module global object, you need to pass it in as you wrote later. But in wasm (unlike asm.js) the module must declare a minimum and maximum size. See the |
So I'm taking it then that is a compile-time setting? Ie. a setting that will have to be set when you guys convert box2d to the WASM module and not something I can set now using the already built WASM library? Sorry if I'm asking stupid questions but I couldnt find anything by googling for WASM_MEM_MAX. |
Yeah, sorry for not being more clear. That's an emscripten compile-time option. Although, thinking some more, we should probably just enable memory growth for the wasm build, since growth is fast there (unlike asm.js) and it solves not just this problem but also lets you not worry much about the initial memory size. |
Thanks for the clarification. Any ideas on when you guys will be able to enable the memory growth setting? Is there any way I can help? I'm really keen on trying the WASM version as I do see quite a speed improvement :). It's just the memory size limit holding us back from moving over at the moment. But thanks for the effort for the box2d port ! |
Well, it should be as easy as adding the flag (
Looking in the makefile, If you have time to figure out what's going on with the 2 versions (do we need both?) and what's going on with |
I'll see if I can get a basic build working on my side, and no I don't think its really necessary to support both (in my opinion), I would say lets just try to get the 2.3.1 version working? Not sure what the major differences are between them. |
Yeah, my intuition is also that we just need the latest. Might be worth looking through the history and issue tracker here, might be we support both for a good reason I can't remember. |
Hi @kripken , I'll have some time this week to look at this. I'm trying to compile using emmake, but get the following error: LLVM version appears incorrect (seeing "9.1", expected "6.0") I'm assuming I'm using a newer version of emscripten or something? Should I try downgrade my emscripten or should I rather try and get it working with my version? Full error trace:
|
Hmm, there is no LLVM 9.1 (last release is 6.0, svn is at 7.0) so something is going very wrong there when it tries to run clang to check the version. Anyhow, if you get the emsdk, it should provide a proper build of LLVM for you. If not, maybe you're hitting an unknown bug? |
Thanks! Using emsdk I can now at least start the build 👍 I get errors like the following now:
but at least the toolchain seems to be working now. I guess thats what happens if you just mindlessly install emscripten using something like brew without really knowing what you're doing :) I think I'll be able to get somewhere from here, so thanks again. |
Hi there,
Setting TOTAL_MEMORY as per the WASM example doesn't seem to work, I still get a 16mb total heap for Box2D. Not sure if I did something wrong, but I added the:
And it doesn't seem to make a difference.
I then tried to set the max memory like this:
But then I get the error:
Which makes me think somewhere in the webassembly the size is also configured - as I'm trying to set it to 256mb which is also 16 times bigger than 16mb.
Any ideas?
The text was updated successfully, but these errors were encountered: