render3d: R3D_VKMEM=<frame> says where the GPU memory is, by owner, and the renderer's big CPU arrays

Every allocation carries the owner its maker was wrapped in (models, terrain, impostor atlases,
scatter, grass, shadow maps, frame targets, sky, water, game textures, made in a frame), and the
report prints each owner's images and buffers, the 25 largest images and the scatter layers',
streams' and terrain's CPU copies. Nothing drawn changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-29 15:58:59 +03:00
parent f65bd1aca1
commit 6289564382
17 changed files with 315 additions and 15 deletions

View file

@ -37,8 +37,16 @@ function sky_dir_from_uv(o: floats, u: float, v: float) -> void {
v3_set(o, st * Math.sin(phi), Math.cos(theta), -(st * Math.cos(phi)))
}
@alloc_ok("start-up: the device, its tables, the programs, the passes and the world's first textures are made once, before play")
# the GPU memory it makes is counted as VKM_SKY (R3D_VKMEM)
function sky_load(render3d_st: mut Render3dState, path: string) -> bool {
let was = render3d_st.gvk_tag
render3d_st.gvk_tag = VKM_SKY
let r = sky_load__t(render3d_st, path)
render3d_st.gvk_tag = was
return r
}
@alloc_ok("start-up: the device, its tables, the programs, the passes and the world's first textures are made once, before play")
function sky_load__t(render3d_st: mut Render3dState, path: string) -> bool {
render3d_st.sky_tex = tex_load_hdr(render3d_st, path)
if render3d_st.sky_tex == 0 { return false }
render3d_st.sky_w = render3d_st.tex_w; render3d_st.sky_h = render3d_st.tex_h