You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have generated bgfx for emscripten using "genie --gcc=asmjs gmake" command then i have built metaballs sample using "mingw32-make -C .build/projects/gmake-asmjs config=release example-02-metaballs" command.
Here metaballs sample runs fine.
Now i have copy-pasted the metaball source code to an external project which uses CMake. I link to .build/asmjs/bin/libbgfxRelease.a and .build/asmjs/bin/libexample-commonRelease.a and all compile well with emscripten.
But when i run the sample, i get the following error :
" Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 16777216, (2) compile with ALLOW_MEMORY_GROWTH which adjusts the size at runtime but prevents some optimizations, or (3) set Module.TOTAL_MEMORY before the program runs. "
I added some traces and the error happens when i reach :
bool bgfx::init(...)
{
[....]
s_ctx = BX_ALIGNED_NEW(g_allocator, Context, 16);
}
A sizeof(Context) indicates 19839040 which is higher thant 16777216 indicated by the error message.
Is there any flag setted by genie about memory when it generates the asmjs project ?
Have you any idea about the issue ?
Regards,
Harold
The text was updated successfully, but these errors were encountered:
Yup, sorry for the off-topic :) I just do not know how to send to you a private message or a simple email .
Adding "-s TOTAL_MEMORY=268435456 " fix the issue, thanks !
Strangely, if i try to add "-s ALLOW_MEMORY_GROWTH=1 " the frame time of metaballs sample increases from 16 to ~40 ... This flag seems to drop some optimisations.
Hello,
I have generated bgfx for emscripten using "genie --gcc=asmjs gmake" command then i have built metaballs sample using "mingw32-make -C .build/projects/gmake-asmjs config=release example-02-metaballs" command.
Here metaballs sample runs fine.
Now i have copy-pasted the metaball source code to an external project which uses CMake. I link to .build/asmjs/bin/libbgfxRelease.a and .build/asmjs/bin/libexample-commonRelease.a and all compile well with emscripten.
But when i run the sample, i get the following error :
" Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 16777216, (2) compile with ALLOW_MEMORY_GROWTH which adjusts the size at runtime but prevents some optimizations, or (3) set Module.TOTAL_MEMORY before the program runs. "
I added some traces and the error happens when i reach :
bool bgfx::init(...)
{
[....]
s_ctx = BX_ALIGNED_NEW(g_allocator, Context, 16);
}
A sizeof(Context) indicates 19839040 which is higher thant 16777216 indicated by the error message.
Is there any flag setted by genie about memory when it generates the asmjs project ?
Have you any idea about the issue ?
Regards,
Harold
The text was updated successfully, but these errors were encountered: