Skip to content

feat(en-014): feature-gate models3d + image-extras for pure-2D games#64

Merged
proggeramlug merged 3 commits into
mainfrom
feat/2d-feature-gates-pr
Jun 12, 2026
Merged

feat(en-014): feature-gate models3d + image-extras for pure-2D games#64
proggeramlug merged 3 commits into
mainfrom
feat/2d-feature-gates-pr

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

Summary

  • bloom-shared: new models3d cargo feature (gltf, gltf_json, image_dds, ModelManager, model staging) and image-extras (JPEG/BMP/TGA/HDR codecs — PNG stays always-on). Both default-on, so existing games are unaffected.
  • bloom-macos: forwards the new features; the HDR env-map decode (bloom_set_env_clear_from_hdr) is gated behind image-extras; 24 model/HDR FFI exports are cfg-gated with ABI-stable warn-once no-op stubs when features are off (Perry's TS glue references every FFI symbol an imported module declares, even uncalled ones, so the symbols must exist).
  • Also includes the watchOS gen_stubs manual-override support and the ticket-022 SDF texture usage flags that were on the same working tree.

Motivation

A pure-2D game (Bloom Jump) was shipping gltf/gltf_json/image_dds and the non-PNG image decoders in every binary. With Perry's new per-project nativeLibrary feature forwarding (perry >= 0.5.1126), games opt out via perry.toml:

[native-library."@bloomengine/engine"]
default-features = false

which also drops Jolt via the existing jolt feature. Measured on Bloom Jump (macOS, with the perry-side fixes): 26.1MB → 17.3MB, game verified rendering + audio.

Compatibility

  • Defaults unchanged — cargo build produces the same engine as before.
  • Disabled-feature failure modes: unknown image formats fail decode at runtime (PNG always works); model FFI calls hit warn-once no-op stubs.
  • Platform crates other than macos don't declare the new features yet (follow-up; absence of an override means defaults, i.e. unchanged behavior).

Testing

  • cargo check green on bloom-shared and bloom-macos for default, --no-default-features, and mixed profiles.
  • Bloom Jump built lean end-to-end, window capture verified menu render, OGG music decode confirmed.

…rator updates

- bloom-shared: new models3d (gltf/image_dds) and image-extras (jpeg/bmp/
  tga/hdr) cargo features, default-on; pure-2D games opt out via Perry's
  per-package feature forwarding
- macos: forward the new features; HDR decode gated behind image-extras
- watchOS: gen_stubs.js manual-override support (ffi_stubs_manual.rs),
  draw-list + Swift host updates
- mesh SDF textures allocate COPY_DST for ticket 022 disk cache
- gitignore: perry cache, local jolt cmake tree, sweep outputs
The wasm build compiles bloom-shared with --no-default-features, so the
new EN-014 gates removed EngineState.models out from under bloom-web's
unconditional model FFI (24 build errors in CI). Web games do use 3D
models, so the web crate now declares the same default-on feature set
as native/macos; pure-2D web games opt out via Perry feature
forwarding once the web FFI surface is gated (tracked for the FFI
consolidation work).
Same break class as the web fix one commit back: every platform crate
compiles bloom-shared with default-features = false, so the EN-014
gates removed EngineState.models from all of them while their model
FFI stayed unconditional (build-linux CI failure; windows/android/
ios/tvos would fail identically, they're just not in CI). Mirror the
macos feature block everywhere.
@proggeramlug proggeramlug merged commit d86db22 into main Jun 12, 2026
8 checks passed
@proggeramlug proggeramlug deleted the feat/2d-feature-gates-pr branch June 12, 2026 20:00
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