render3d: frame keeps 32 to 16 - tables and queues sized at start-up, the rest declared; birth leaks freed
The texture and framebuffer tables grow to 4096/1024 and gvk_prime's queue is made in gvk_startup_state; gpu_unit_2d's and the actor lists' lazy starts go. @alloc_ok on layer_room (a layer outgrowing its cap), overlay_init, gvk_read_screen, gvk_hdr_metadata (a settings change), DLSS's gsl_struct/gsl_fn, an actor's part tables (given back by actor_release) and the pool's fallback. Birth leaks freed: gpu_caps_probe's create structs, gpu_caps_fake's text, gvk_note's line, gvk_layout_key's table and each key it grew from, ov_text_wrap's slices, the default sky path. (ludic deps --births still lists freed sites: its walk does not see free().) Compiled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
6fb5118afd
commit
46000362ba
9 changed files with 60 additions and 20 deletions
|
|
@ -45,6 +45,7 @@ function ov_pick_prog(render3d_st: mut Render3dState) -> void {
|
|||
render3d_st.ov_prog = render3d_st.ov_prog_sdr
|
||||
}
|
||||
|
||||
@alloc_ok("start-up: the overlay's tables are made once")
|
||||
function overlay_init(render3d_st: mut Render3dState, font_dir: string) -> bool {
|
||||
r3d_program_log(render3d_st, "overlay.vert", "overlay.frag", "")
|
||||
render3d_st.ov_prog = gpu_program(render3d_st, "overlay.vert", "overlay.frag", "")
|
||||
|
|
@ -340,11 +341,14 @@ function ov_text_wrap(render3d_st: mut Render3dState, x: int, y: int, size: int,
|
|||
if sp[i] == 10 { stop = i; break }
|
||||
if sp[i] == 32 { last_space = i }
|
||||
let piece: string = s[first .. i + 1]
|
||||
if ov_text_w(render3d_st, size, piece) > maxw and last_space > first { stop = last_space; break }
|
||||
let pw = ov_text_w(render3d_st, size, piece)
|
||||
free(piece)
|
||||
if pw > maxw and last_space > first { stop = last_space; break }
|
||||
i += 1
|
||||
}
|
||||
let line: string = s[first .. stop]
|
||||
ov_text(render3d_st, x, ly, size, line, r, g, b, a)
|
||||
free(line)
|
||||
ly += size * 13 / 10
|
||||
first = stop
|
||||
while first < n and (sp[first] == 32 or sp[first] == 10) { first += 1 }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue