rendertarget_metrics(3)
π rendertarget_metrics β Arcan Lua API, section 3
okay so bestie, welcome to rendertarget_metrics(3) β yes that's the manual page name, yes it's from the Arcan Lua API, and yes we're gonna get into it π
β¨ NAME β¨
rendertarget_metrics β it pulls up the receipts π on what's going on inside a rendertarget pipeline. literally stats, no cap.
πΈ SYNOPSIS πΈ
table
rendertarget_metrics( vid:rtgt )
π¦ DESCRIPTION π¦
So like, sometimes you wanna make a decision based on the generic state of a pipeline. not a specific thing, just the overall vibe check of it, y'know? the classic case is post processing filters that are just way too expensive to apply on every single frame β like, bestie, your GPU is NOT doing allat every 16ms π
The easiest approach then has been to attach it to a lower refresh clock, but β plot twist β that creates visible latency in the effect that might be quite visible, and it might still update redundantly. so you're paying in vibes and getting nothing back. tragic.
The other option is to have a preframe handler that determines if it is worthwhile to add more work to the queue or not. and to make that kind of heuristic, some input is needed π this function is literally the input. use it to retrieve some information about what is going on in a render pipeline without forcing manual tracking. no notebook, no spreadsheet, it just tells you. slay.
The fields in the returned table are:
int:dirtyβ how many times the dirty counter has been incremented since last render pass. it's been busy πint:transfersβ the number of external uploads since last render pass.int:updatesβ the number of ongoing transforms.int:time_moveβ the relative clock of the last move transform.int:time_scaleβ the relative clock of the last scale transform.int:time_rotateβ the relative clock of the last rotation transform.int:time_blendβ the relative clock of the last blend transform.
fr fr β they're all int fields, so don't go expecting floats and then act surprised. π
π EXAMPLE π
function rendertarget_metrics0()
local anim = fill_surface(32, 32, 255, 0, 0)
show_image(anim, 100)
move_image(anim, 100, 100, 200)
_G[APPLID .. "_preframe_pulse"] = function()
for k,v in pairs(rendertarget_metrics(WORLDID)) do
print(k, v)
end
end
end
like look at her go β fill_surface(32, 32, 255, 0, 0), show_image(anim, 100), move_image(anim, 100, 100, 200), and then a _G[APPLID .. "_preframe_pulse"] handler that loops with pairs(rendertarget_metrics(WORLDID)) and just print(k, v) everything. main character energy honestly π
π SEE ALSO π
targetcontrol
that's the whole page bestie, go forth and profile β¨ this iconic little entry is from the Arcan Lua API, dated October 2026 π π«Ά (and yes, targetcontrol is your one and only SEE ALSO β she's carrying the whole reference section on her back, periodt π)
π¦ where this page comes from
- nixos 26.05: arcan 0.7.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms