Skip to content

fix(examples): outline post-FX + missing Color export (#48)#51

Merged
proggeramlug merged 1 commit intomainfrom
fix/issue-48-postfx-color-export
May 1, 2026
Merged

fix(examples): outline post-FX + missing Color export (#48)#51
proggeramlug merged 1 commit intomainfrom
fix/issue-48-postfx-color-export

Conversation

@proggeramlug
Copy link
Copy Markdown
Contributor

Summary

Fixes two confirmed bugs from #48 that broke most of the example projects on macOS.

  • outline_bg bind group validation error. The R32Float object-ID texture was declared Float { filterable: true } in postfx.rs, which requires the wgpu FLOAT32_FILTERABLE feature — not advertised by Apple GPUs. Switched the binding to filterable: false and the shader to textureLoad (semantically correct, since IDs shouldn't be interpolated). This is the cause of the test-gltf-watch crash and likely cascades into several of the other macOS rendering failures.
  • Missing _perry_fn_src_core_colors_ts__Color symbol. The export { ColorConstants as Color } from './colors' rename re-export in src/core/index.ts produces no FFI symbol under Perry. Made Color a real top-level binding in colors.ts and kept ColorConstants as an aliased export for backward compat. Unblocks pong, dungeon-crawl, kart-racer, isometric-rpg, space-blaster, voxel-sandbox.

Does not address the other items in #48 (scene_node_ib divisible-by-3, the bistro/sponza black screens, pbr-spheres flat lighting) — those need more diagnosis and probably hardware info from the reporter.

Test plan

  • cargo checknative/macos
  • cargo checknative/shared (wasm32 target with --features web)
  • Run examples/test-gltf-watch on macOS and confirm it no longer crashes with the outline_bg validation error
  • Run examples/pong on macOS and confirm the linker no longer reports Undefined symbol _perry_fn_src_core_colors_ts__Color
  • Verify outline post-FX still visually works on a Linux/Vulkan or Windows/DX12 setup (where FLOAT32_FILTERABLE is typically advertised) — the textureLoad path should produce identical results since IDs are integer-valued

Two unrelated bugs surfaced together when @adevart tried the example
projects on macOS:

1. `outline_bg` bind group failed validation on Apple GPUs because the
   R32Float object-ID texture was declared `Float { filterable: true }`,
   which requires the FLOAT32_FILTERABLE wgpu feature (not advertised by
   Metal). Switch the binding to `filterable: false` and use textureLoad
   instead of textureSample for the ID lookup — semantically correct
   anyway, since IDs should never be interpolated.

2. The `export { ColorConstants as Color } from './colors'` rename in
   src/core/index.ts produced no Perry FFI symbol for `Color`, so any
   example importing `Color` from `bloom/core` (pong, dungeon-crawl,
   kart-racer, isometric-rpg, space-blaster, voxel-sandbox) failed to
   link with `Undefined symbol _perry_fn_src_core_colors_ts__Color`.
   Make `Color` a real top-level binding in colors.ts and keep
   `ColorConstants` as an aliased export.
@proggeramlug proggeramlug merged commit d687ac2 into main May 1, 2026
8 checks passed
@proggeramlug proggeramlug deleted the fix/issue-48-postfx-color-export branch May 1, 2026 19:22
proggeramlug added a commit that referenced this pull request May 1, 2026
FULLSCREEN_VERT and OUTLINE_FRAG both declared `struct VertexOutput`,
which becomes a redefinition once `format!("{}\n{}", ...)` concatenates
them. Naga used to mask this behind the earlier bind-group filterable
validation error; now that #51 fixed that, the shader-parse error
surfaces and breaks the entire post-FX pipeline init on every example.

Validated by parsing the concatenated source with naga 29.0.0 — passes.
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