Skip to content

v0.4.1

Choose a tag to compare

@github-actions github-actions released this 07 Aug 10:01
· 212 commits to main since this release

A performance-only patch release. It trims the CPU cost of the per-draw state snapshot, the path the API thread runs on every draw call to hand render state to the encoder thread, which the frame-pointer profiles introduced in 0.4.0 identified as the single hottest piece of the translation layer in busy scenes.

Four things changed, none of them rendering behaviour. The per-frame scratch arena's bump allocation is now split so the common case inlines into its callers; the unsplit function was just large enough that the compiler kept it out of line, and at snapshot rates that meant a full call per 16-byte bump. The bind-time texture checks (pending mip uploads, cross-device migration) now gate inline on a dirty mask and only call out when there is real work, instead of paying an out-of-line call per bound texture per draw that almost always found nothing to do. The texture-stage walk keeps an incremental mask of bound slots and visits only those, rather than probing all 16 stages and re-initialising a 1 KB scratch array per state-dirty draw. And the small fixed-function constant payloads (texture factor, alpha ref, fog colour, bump-env matrices, integer constants) are built in fixed stack buffers instead of round-tripping a heap allocation each time they change.

Measured on a busy scene with the built-in perf summary, the snapshot path drops from about 229 to 202 ns per draw, with the stage-walk share falling from 46 to 28 ns. At the several thousand draws per frame a crowded scene produces, that returns roughly a tenth of a millisecond per frame to the API thread, which is the bottleneck thread in exactly those scenes.

Installing is unchanged, and covered in INSTALL.md inside the bundle.

Full changelog: v0.4.0...v0.4.1