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

@ -294,7 +294,14 @@ function water_body_add(render3d_st: mut Render3dState, level: float, cx: float,
}
# one reflecting plane: what this function always meant, without a new mesh and program
# every time it is called
# the GPU memory it makes is counted as VKM_WATER (R3D_VKMEM)
function water_init(render3d_st: mut Render3dState, level: float, cx: float, cz: float, ex: float, ez: float) -> void {
let was = render3d_st.gvk_tag
render3d_st.gvk_tag = VKM_WATER
water_init__t(render3d_st, level, cx, cz, ex, ez)
render3d_st.gvk_tag = was
}
function water_init__t(render3d_st: mut Render3dState, level: float, cx: float, cz: float, ex: float, ez: float) -> void {
water_bodies_clear(render3d_st)
water_body_add(render3d_st, level, cx, cz, ex, ez, true)
}