Skip to content

Translate shader bundles to WGSL at build time, behind an opt-in - #472

Merged
bdero merged 5 commits into
masterfrom
bdero/build-time-wgsl
Oct 11, 2026
Merged

bdero merged 5 commits into
masterfrom
bdero/build-time-wgsl

Conversation

@bdero

@bdero bdero commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Stacked on #471.

Adds flutter_scene_tint, a native SPIR-V to WGSL tool released from this repo (flutter_scene_tint-0.1.0), and a build-hook step that writes a .wgsl.json sidecar beside each shader bundle when flutter_scene_webgpu: true is set under hooks: user_defines:. Off by default and not read by anything yet; it is the input the WebGPU backend in the next PR loads. Also replaces the debug shader's isnan/isinf, which WGSL cannot express, with bit tests.

@bdero bdero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two actionable findings in the WGSL build path, covering named shader entry points and native build caching.

Comment thread packages/flutter_scene/lib/src/generated_assets/wgsl_sidecar.dart Outdated
Comment thread packages/flutter_scene/lib/src/generated_assets/build_engine_assets.dart Outdated
Base automatically changed from bdero/gpu-host-seam-web-facade to master October 6, 2026 07:21
@bdero
bdero force-pushed the bdero/build-time-wgsl branch from a5e0372 to 74b64f9 Compare October 6, 2026 07:56
@argos-ci

argos-ci Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
ios (Inspect) ✅ No changes detected - Oct 11, 2026, 4:33 AM
macos (Inspect) ✅ No changes detected - Oct 11, 2026, 4:24 AM

bdero added 5 commits October 10, 2026 20:39
isnan and isinf have no WGSL equivalent, so Tint rejects every shader
that uses them. IEEE bit tests through floatBitsToUint work in every
shading language, and fast math cannot fold them away.
Built from a pinned Dawn revision with the SPIR-V reader on, which
Dawn's own prebuilt tint leaves off. A flutter_scene_tint-* tag builds
it for macOS, Linux, and Windows and publishes the binaries with a
sha256 manifest.
With flutter_scene_webgpu: true under hooks: user_defines:, shader
bundles get a .wgsl.json sidecar beside them: each shader's Vulkan
SPIR-V translated by the released flutter_scene_tint (downloaded and
sha256-checked), its bindings verified, and the reflection it binds
by. Constant arrays are hoisted before translation so Tint does not
copy them per use. Off by default, and nothing reads the sidecars yet.
@bdero
bdero force-pushed the bdero/build-time-wgsl branch from 74b64f9 to 122aad1 Compare October 11, 2026 04:03
@bdero
bdero merged commit 05ee62c into master Oct 11, 2026
25 checks passed
@bdero
bdero deleted the bdero/build-time-wgsl branch October 11, 2026 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Project building platform:web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant