Skip to content

Anim opt - #84

Merged
HailToDodongo merged 4 commits into
mainfrom
anim_opt
Oct 6, 2026
Merged

HailToDodongo merged 4 commits into
mainfrom
anim_opt

Conversation

@HailToDodongo

Copy link
Copy Markdown
Owner

No description provided.

@HailToDodongo
HailToDodongo merged commit 1029791 into main Oct 6, 2026
2 of 4 checks passed
@HailToDodongo
HailToDodongo deleted the anim_opt branch October 15, 2026 21:57
ottj added a commit to ottj/tiny3d that referenced this pull request Oct 22, 2026
…on the sr64 fork

Cherry-picked from upstream 1029791 (Max Bebök, 2026-10-06): keyframes
stream from ROM by DMA through a small double buffer per animation
instead of a FILE, T3DBone keeps a 4x3 matrix (96 B, 16-aligned), and the
skeleton/animation update paths are faster. Only HailToDodongo#84 — the precision fix
(HailToDodongo#81) and the RSPL microcode port stay for the full upstream update, so
upstream's breakingChanges.md (which documents both) is left out.

Conflicts with the fork, resolved:
- The fork's memory keyframe source (dataPtr) is replaced by upstream's
  ROM stream. sr64 builds its animations by hand around its own
  T3DChunkAnim, so a new t3d_anim_set_source_rom() starts the stream from
  a ROM address with a CALLER-supplied buffer; T3DAnim.ownsBuffer tells
  t3d_anim_destroy / _destroy_free whether tiny3d allocated the buffer
  (and frees it) or the caller did (and keeps it). destroy_free waits for
  the stream's DMA before anything is released.
- The fork's no-source safety stays: an animation with no stream reads
  no keyframes (a static pose) instead of DMAing into NULL, and a channel
  whose window never opened is skipped instead of divided by zero.
- Weighted skinning: the inverse bind poses are 4x3 too (48 B per bone,
  was 64), computed once at create through the existing 4x4 affine
  invert, and the skin matrix is mat4x3_mul(world, IBM) -> mat4x3_to_fixed.
  A clone without inverse bind poses takes upstream's plain path.

Measured in sr64 (b30, 24-actor fight): the animation pool's demand peak
161 -> 136 KB and its 46 fragmentation spills -> 0.

(cherry picked from commit 1029791)

This branch had an error being deployed

1 failed deployment
github-pages — 1bdebea7 Deployed Oct 6, 2026 by HailToDodongo via deploy #119
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant