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:
parent
2fe4018d28
commit
9b482d609a
14 changed files with 208 additions and 39 deletions
|
|
@ -1460,10 +1460,10 @@ function gvk_program_new(render3d_st: mut Render3dState, vs: string, fs: string,
|
|||
|
||||
function gvk_mesh_free(render3d_st: mut Render3dState, m: Mesh) -> void {
|
||||
if m == null { return }
|
||||
if m.vbufs != null { for i in 0 .. m.n_vbufs { if m.vbufs[i] > 0 { gvk_buf_release(render3d_st, m.vbufs[i]) } } }
|
||||
if m.vbufs != null { for i in 0 .. m.n_vbufs { if m.vbufs[i] > 0 { gvk_buf_delete(render3d_st, m.vbufs[i]) } } }
|
||||
m.n_vbufs = 0
|
||||
m.vbo = 0
|
||||
if m.ebo > 0 { gvk_buf_release(render3d_st, m.ebo); m.ebo = 0 }
|
||||
if m.ebo > 0 { gvk_buf_delete(render3d_st, m.ebo); m.ebo = 0 }
|
||||
}
|
||||
|
||||
function gvk_scissor(render3d_st: mut Render3dState, x: int, y: int, w: int, h: int) -> void {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue