render3d: 671 frame-reachable allocation sites to 161 - declared, split, or made nothing
@alloc_ok with its reason on what is made once per resource and kept (textures, programs, samplers, views, layouts, memory blocks, the pipeline cache in gvk_pipe_build), on resize and swapchain remakes, on screenshots and dumps, on a world being set up (streams, layers, water, post, bakes), on loads (gltf_load, skin_load, tex_load*, png_decode, fonts) and on R3D_PROF / drawstats. gltf_cached's hit path is its own and makes nothing; the miss (gltf_cached_load) is declared. m4_look_at (now over m4_look_at_xyz) and m4_inverse work on scalars, and cam_update makes no scratch. Left: lazy first-use starts, error and debug prints, and scratch made and freed each call (churn, plan 25.3). Compiled (steady, and ludic deps over the game). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f2dd27f443
commit
5d0f83b81c
21 changed files with 118 additions and 42 deletions
|
|
@ -51,6 +51,7 @@ function gltf_mat_remember(render3d_st: mut Render3dState, name: string, diff: i
|
|||
render3d_st.gltf_mat_n += 1
|
||||
}
|
||||
|
||||
@alloc_ok("loading a model, a texture or a font: a load, not a frame (a guest loading a teammate's look is one)")
|
||||
function gltf_texture(render3d_st: mut Render3dState, uri: string, srgb: bool) -> int {
|
||||
if render3d_st.gltf_tex_paths == null { render3d_st.gltf_tex_paths = new []pointer; render3d_st.gltf_tex_ids = words(256); render3d_st.gltf_tex_refs = words(256) }
|
||||
var png: string = uri
|
||||
|
|
@ -174,6 +175,7 @@ function gltf_prim(render3d_st: mut Render3dState, p: Val) -> Prim {
|
|||
}
|
||||
|
||||
# Load the mesh of the node called `node_name` from dir/file.
|
||||
@alloc_ok("loading a model, a texture or a font: a load, not a frame (a guest loading a teammate's look is one)")
|
||||
function gltf_load(render3d_st: mut Render3dState, dir: string, file: string, node_name: string) -> Model {
|
||||
render3d_st.gltf_dir = dir
|
||||
let at = dir + "/" + file
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue