v0.12.5: WebGL2 fixes
The WebGL2 fallback works in v0.12.5, a patch release with no API changes.
Uniform padding on OpenGL and WebGL2
Section titled “Uniform padding on OpenGL and WebGL2”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.
Readback on WebGL2
Section titled “Readback on WebGL2”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.
GPU errors in the browser console
Section titled “GPU errors in the browser console”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.
A tidier repository
Section titled “A tidier repository”Four changes clear the repository root for first visitors:
- Build, run, and check scripts live in
tools/behind a single./fcdispatcher:./fclists them, and./fc testruns one. - The
uniffi-bindgenhelper moved intosrc/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