Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Mixing system emcc with the versioned SDK from this package can cause mismatches in memory layouts, resulting in errors and crashes.
I discovered this because none of the demos here were working for me. They all saw GL errors when initializing
sokol-gfx
. It looked like the context attributes were corrupted between where they were written in_sapp_emsc_webgl_init
and where they were read in_emscripten_webgl_do_create_context
- the requested context major version was 0. It looked like an issue with struct layout: on the JS side,renderViaOffscreenBackBuffer
looked like it was read as 2, which was certainly suspicious.Syncing my system Emscripten version with the package version seemed to solve the issue, although it was always hard to be 100% sure I've cleared out all relevant build caches correctly. (Hardcoding the GL major version to 2 in JS also worked, but was a lot less informative.)
This change removes the most obvious source of cross-contamination I could find: it avoids using system emcc entirely. I seem to be getting successful builds now, but it might be worth testing this yourself.