Skip to content

v0.12.5: WebGL2 fixes

The WebGL2 fallback works in v0.12.5, a patch release with no API changes.

Shaders with a uniform binding whose size is not a multiple of 16 bytes, such as a bare f32, a vec2<f32>, or most structs, failed to build a pipeline on OpenGL and WebGL2, where wgpu requires bindings aligned to 16 bytes. FragmentColor now pads them for you. On a backend that needs it, each shader compiles a variant of its module in which structs get a padded copy and bare values a wrapper, with every use rewritten. Uniform names, keys, and offsets stay the same, and no shader source has to change.

TextureTarget::get_image and Renderer::read_storage hung on WebGL2, where the buffer map callback only fires when the device is polled. The web readback path now polls and yields to the event loop until the map resolves.

The error handler printed GPU validation errors through stdout, which WebAssembly discards. Now it logs them to the browser console. The web healthcheck also gained a second pass that runs with navigator.gpu removed, keeping the WebGL2 path covered.

Four changes clear the repository root for first visitors:

  • Build, run, and check scripts live in tools/ behind a single ./fc dispatcher: ./fc lists them, and ./fc test runs one.
  • The uniffi-bindgen helper moved into src/bin.
  • READMEs for npm and PyPI sit beside their packages under platforms/.
  • Three stale files are gone.

CI and the documentation call the new paths.

Release notes: GitHub v0.12.5.

Rafael