render3d: VkAllocationCallbacks counted (R3D_ALLOC_VK), pipeline create infos freed, actor pool at init

Plan 25.1c: vk_mac.ll's @lvk_ac (posix_memalign under a 16-byte header of scope/offset/size, atomic
counters) passed at every render3d create/destroy (49 sites; the caps probe keeps its own null pair);
lvk_ac_bytes/_peak/_allocs/_scope_bytes for the fence, Vk.alloc_bytes. vk_win.ll: null and 0.
MoltenVK 1.4.2 counted 0 live bytes through them in steady. Fence findings: gvk_pipeline freed its 17
create infos (and reuses one bufs list); actor_init fills ac_spare with 512 records (actor_fresh,
m4_new, v3_new at first placement in play). Compiled, not run (the user's call).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-28 15:46:19 +03:00
parent edb33400b3
commit df6ea046c3
10 changed files with 266 additions and 52 deletions

View file

@ -41,6 +41,7 @@ property Actor {
outline: float = 0.0, # float bits: metres of rim drawn around it (0 = none)
ocol: floats # the rim's colour (null = white)
}
const ACTOR_POOL: int = 512
# a program and its uniform locations
property AcProg {
prog: int = 0,
@ -75,6 +76,16 @@ function ac_prog_new(render3d_st: mut Render3dState, vs: string, fs: string, def
return a
}
function actor_init(render3d_st: mut Render3dState) -> void {
# the records play takes, made now: an actor first placed in play (a fish, a sign, a bed) made its
# record, matrix and tint then (actor_release gives them back to this pool)
if render3d_st.ac_spare == null { render3d_st.ac_spare = new []Actor }
let sp = render3d_st.ac_spare
for i in 0 .. ACTOR_POOL {
let a = new Actor
a.tint = v3_new(1.0, 1.0, 1.0)
a.mat = m4_new()
push(sp, a)
}
render3d_st.ac_lit = ac_prog_new(render3d_st, "skin.vert", "model.frag", "")
render3d_st.ac_lit_cut = ac_prog_new(render3d_st, "skin.vert", "model.frag", "#define ALPHA_TEST\n")
render3d_st.ac_sh = ac_prog_new(render3d_st, "skin.vert", "shadow.frag", "#define SHADOW_PASS\n")