rendertarget_metrics(3)

πŸ“¦
version 0.7.1 Β· 2 versions
, in nixos 26.05

πŸ’… 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