render3d: @creates / @releases on its handles

GpuBuffer (gpu_buffer_new/free), GpuTexture, GpuFramebuffer, GpuRenderbuffer, Target (target_new/free),
Model (gltf_load / model_release), Mesh (gpu_mesh_new / gpu_mesh_free, mesh_release), Actor
(actor_new / actor_release) and SkinClone (skin_clone / skin_clone_free), for ludic deps --resources.
Compiled (steady).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-28 16:58:31 +03:00
parent a0c6f8ce7f
commit 0b89ed85b7
6 changed files with 19 additions and 0 deletions

View file

@ -60,6 +60,7 @@ function gltf_mats_forget(render3d_st: mut Render3dState, id: int) -> void {
# primitives, their meshes and the model itself are freed, and a model gltf_cached handed out
# leaves its cache. The caller says when: nothing may draw the model, or hold it, afterwards. For
# a model gltf_load or gltf_cached made (a procedural one - a card, a blade - owns its parts otherwise).
@releases(Model)
function model_release(render3d_st: mut Render3dState, m: Model) -> void {
if m == null { return }
gltf_cached_forget(render3d_st, m)
@ -78,6 +79,7 @@ function model_release(render3d_st: mut Render3dState, m: Model) -> void {
}
# a mesh and what it holds: its buffers (their handles given back), its layout and buffer lists
@releases(Mesh)
function mesh_release(render3d_st: mut Render3dState, me: Mesh) -> void {
gpu_mesh_free(render3d_st, me)
if me.attrs != null { free(me.attrs) }