render3d: recycle texture and buffer ids, free a released model whole, actor_release

A freed texture or buffer id goes on a spare list the next one takes; tex_note_size keeps sizes by id.
model_release frees prims, meshes, material names, the skin and leaves gltf_cached. actor_release
takes an actor off the stage and actor_new reuses its record (ECS's Things come and go all day).
steady.ludic: an actor round at 0 bytes over 2000.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-28 12:00:53 +03:00
parent 2fe4018d28
commit 9b482d609a
14 changed files with 208 additions and 39 deletions

View file

@ -86,6 +86,7 @@ function read_one(anim_st: AnimState, render3d_st: mut Render3dState, a: Val) ->
c.ckeys[k] = nk
c.coff[k] = at
for i in 0 .. nk { c.times[at + i] = tb[i] }
free(tb)
if nk > 0 and c.times[at + nk - 1] > c.dur { c.dur = c.times[at + nk - 1] }
at += nk
let vb = gltf_accessor_floats(render3d_st, value_as_int(value_get(sp, "output")))
@ -93,6 +94,7 @@ function read_one(anim_st: AnimState, render3d_st: mut Render3dState, a: Val) ->
if c.cpath[k] == AC_ROT { comps = 4 }
c.cvoff[k] = av
for i in 0 .. nk * comps { c.vals[av + i] = vb[i] }
free(vb)
av += nk * comps
k += 1
}