Skip to content

Fix for Emscripten 4.0.9#1026

Merged
MarkCallow merged 6 commits intomainfrom
fix_for_emscripten_4.0.9
May 26, 2025
Merged

Fix for Emscripten 4.0.9#1026
MarkCallow merged 6 commits intomainfrom
fix_for_emscripten_4.0.9

Conversation

@MarkCallow
Copy link
Collaborator

@MarkCallow MarkCallow commented May 24, 2025

Includes the following fixes to work with Emscripten 4.0.9:

  • Install sdl2 with embuilder as SDL2's config file is no longer installed in SYSROOT without this explicit step.
  • Explicitly allow_raw_pointers() when returning TranscodedImage. Emscripten 4.0.8+ require that this policy be specified.
  • Add HEAP8 method to EXPORTED_RUNTIME_METHODS. Emscripten 4.0.9 removes this method, which is used in the binding.

Fixes scripts/build_wasm_docker.sh to not remove the emscripten Docker container when done so the next run will benefit from the Emscripten cache. Removal can be requested with -r.

Fixes the KTX_PACK_ASTC_ENCODER_MODE_DEFAULT value which was getting its own unique enumerator value instead of being the same value as LDR.

So next run will benefit from Emscripten cache. Just stop it.
It was getting its own unique value instead of being the same as LDR.
Emscripten 3.0.9 was removing this method which is used in the binding.
Emscripten 3.0.8+ require that this policy be specified.
* Make ASTC encoder pick appropriate mode when input is DEFAULT.
* Document the modes in ktx.h.
@MarkCallow MarkCallow merged commit 1a98376 into main May 26, 2025
37 of 53 checks passed
@MarkCallow MarkCallow deleted the fix_for_emscripten_4.0.9 branch May 26, 2025 10:53
richgel999 pushed a commit to BinomialLLC/KTX-Software-Binomial-Fork that referenced this pull request Mar 9, 2026
Includes the following fixes to work with Emscripten 4.0.9:

- Install sdl2 with `embuilder` as SDL2's config file is no longer
  installed in SYSROOT without this explicit step.
- Explicitly allow_raw_pointers() when returning TranscodedImage.
  Emscripten 4.0.8+ require that this policy be specified.
- Add HEAP8 method to EXPORTED_RUNTIME_METHODS. Emscripten 4.0.9
  removes this method, which is used in the binding.

Fix `scripts/build_wasm_docker.sh` to not remove the emscripten Docker
container when done so the next run will benefit from the Emscripten
cache. Removal can be requested with `-r`.

Fix handling of the KTX_PACK_ASTC_ENCODER_MODE_DEFAULT. When
passed in params.mode to ktxTexture2_EncodeAstcEx this value triggered
an assert. The function now picks a  mode appropriate to the bit-depth of
the input texture. Document this handling in ktx.h.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant