You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Downstream report: ABI fix for dynamic-flags reset, +79% csmUpdateModel via per-object dirty skipping, official out-of-range behavior notes (Qt/CubismFramework integration, based on v1.0.1) #3
We're using PurismCore as a drop-in Live2DCubismCore.dll replacement under the official CubismFramework (Qt6 desktop app, large production model: 3713 drawables / 823 params / 705 parts / 314 mask clips). Based on v1.0.1 we found and fixed a few things locally, and wanted to report them upstream:
The official Core's reset only resets the change-detection baseline; it does not clear the flags array. The v1.0.1 in-place clear wipes csmVertexPositionsDidChange bits before the framework's csmGetDrawableDynamicFlags reads them, so the framework's VERTEX_CHANGED-driven mask pipeline never fires (clipping is silently disabled; combined with an uninitialized _bufferIndex in the framework this also caused crashes). Aligning the reset to official semantics makes flag sampling match the official DLL frame-for-frame (64/64 on the first frame, steady state 9/64 on our model).
2. Per-object dirty skipping in csmUpdateModel (+79%)
The official Core skips per-drawable work when inputs are unchanged. Without it, Purism -O3 measured 11.9ms vs official 7.2ms steady state on our model. After adding per-object dirty checks (skip deformer/art-mesh/offscreen work when blend-key indices/weights are unchanged; skip disabled nodes and opacity-0 subtrees entirely), steady-state csmUpdateModel dropped 5.88ms → 1.27ms (-79%, 4.9x) while remaining bit-identical to the non-dirty path when everything changes. Happy to share the patch.
3. Dirty-detection precision fixes
VERTEX_CHANGED should be set only for meshes actually recomputed this frame (gated on mesh_changed), not merely enabled meshes — matches official sparsity and avoids needless vertex re-uploads/mask passes.
Effective parent-part opacity changes must invalidate dependent meshes (a missing dependency in naive dirty checks).
Warp-grid (glue) meshes need two-endpoint fixed-point dirty propagation: if either endpoint is dirty, force both to recompute; otherwise vertices drift frame-over-frame under dirty skipping (visible as mask sampling errors on animated limbs).
4. Official out-of-range parameter behavior (reverse-engineering note)
When a parameter leaves its key table range, the official Core does not clamp or extrapolate from keyforms: it keeps applying the per-frame delta to the stale vertex buffer (linear accumulation, roughly constant per frame; verified by read-back with the parameter held constant). Purism currently disables the whole deformer chain (mesh freezes). No visual impact in normal animation, but flagging in case you want to match this edge behavior.
Bottom line
With the above, PurismCore + framework runs our 3713-drawable model at ~10.5ms/frame total (Update ~2.5-3ms, Draw ~7.5ms) at a stable 30fps, with mask/clipping output visually indistinguishable from the official DLL.
We're happy to prepare patches against 1.1.0 for any of these (especially #1 and #2) if you'd like.
Activity