target_flags(3)
okay so bestie, welcome to target_flags(3) from the Arcan Lua API ๐ this is the little per-target switchboard for special frameserver flags, and weโre gonna go through every single one together.
โจ NAME โจ
target_flags โ Set special frameserver processing flags ๐
๐ธ SYNOPSIS ๐ธ
the synopsis is giving overloaded, so here it is exactly:
nil
target_flags( vid:tgt, number:flag )
target_flags( vid:tgt, number:flag, bool:enable=true )
target_flags( vid:tgt, number:flag, number:max_w, number:max_h )
๐ฆ DESCRIPTION ๐ฆ
Some frameserver features and management behaviors are unsafe to use as a default, so this function lets you enable/disable them on a per-target basis. The flag argument is used to specify the feature in question, and the optional enable argument is if the state should be set to on or off.
The special max_w and max_h argument interpretation is only for the TARGET_FORCESIZE and TARGET_LIMITSIZE flags.
The possible flags are:
TARGET_VSTORE_SYNCHTARGET_SYNCHRONOUSTARGET_NOALPHATARGET_AUTOCLOCKTARGET_VERBOSETARGET_NOBUFFERPASSTARGET_ALLOWCMTARGET_ALLOWLODEFTARGET_ALLOWHDRTARGET_ALLOWVECTORTARGET_ALLOWINPUTTARGET_FORCESIZETARGET_ALLOWGPUTARGET_LIMITSIZETARGET_SYNCHSIZETARGET_BLOCKADOPTTARGET_DRAINQUEUE
๐ NOTES ๐
- flag,
TARGET_VSTORE_SYNCHmakes sure that there is a local copy of the buffer that is also uploaded to theGPU. This saves a readback in cases where direct access to pixel values are needed. ๐พ - flag,
TARGET_SYNCHRONOUSblocksCPU <-> GPUtransfers until the transfer has been marked as completed. This will stall the rendering pipeline and possibly incur a heavy performance impact. ๐ญ - flag,
TARGET_NOALPHAmanually sets the alpha field for new frames to0xff. A faster way of disabling (that would require less memory operations) alpha blending for untrusted sources would be to associate the respectiveVIDs with a shader that doesnโt use or lookup alpha value. ๐จ - flag:
TARGET_AUTOCLOCKis on by default and provides a standardd implementation for some of the autoclock requests that are then filtered and not forwarded to the eventhandler. โฐ - flag:
TARGET_VERBOSEis off by default. Turning it on will emit additional data about delivered or dropped frames. ๐ - flag:
TARGET_NOBUFFERPASSapplies to plaforms where accelerated buffer passing is supported. This can be disabled statically/globally through a platform specific environment variable, and dynamically by setting this flag. The default behavior is to allow buffer passing, but if the graphics (agp) layer gets an invalid buffer, this flag is automatically set to true. ๐ฆ - flag:
TARGET_ALLOWCMallows a client to send/receive color lookup tables for one or several displays. You still need to explicitly specify when- and which tables- are to be sent or retrieved via thevideo_displaygammacall. The event handler will indicate when gamma tables have been updated. ๐ - flag:
TARGET_ALLOWLODEFallows a client to treat its video buffers in half-depth mode. Similar toTARGET_ALLOWHDR, this means that more advanced features than compositing (accessing / manipulating store, direct-feed share and so on) should be avoided. ๐ช - flag:
TARGET_ALLOWHDRallows the client to provide the video buffers in an extended range format with associated metadata. This metadata is descriptive but not normative. If you permit this feature you are responsible for conversion/mapping during composition. Setting this flag will maketarget_verboseattach the metadata to eachframestatusevent delivery to help with this. This can be forcibly overridden / locked by usingimage_metadata. Locking is relevant whenmap_video_displayis used to try to forward without composition, as the metadata of the mapped object will be forwarded to the relevant sink. ๐ - flag:
TARGET_ALLOWVECTORallows a client to treat its video buffers in vector mode. This converts the contents of its buffers to work as textures, and metadata for specifying content in aGPUfriendly triangle- soup format. Like with allow-lodef/hdr. ๐บ - flag:
TARGET_ALLOWINPUTremaps any_IOevents received unto the main event queue rather than being delivered in the normal frameserver bound callback. This allows for semi-transparent controlledIOinjection with all the implications that might have. It is only intended for the cases where overhead needs to be minimized over having a forward from the normal event handler to theappl_input(iotbl)one. ๐ฎ - flag:
TARGET_ALLOWGPUallows a client to authenticate a platform specific token that can provide higher levels ofGPUaccess than the implementation defined default. This is a security tradeoff as it may provide the client with access to read or modify privateGPUstate. ๐ - flag:
TARGET_LIMITSIZEsets an upper limit to the dimensions that the client can negotiate. This is primarily to prevent accidental absurd behavior, such as8192x8192sized mouse cursors. ๐ฑ๏ธ - flag:
TARGET_SYNCHSIZEchanges the semantics for the'resized'event to block the client, pending astepframe_targetcall to release. It is not stable to toggle this flag on as the off state can be activated with a synch pending. On stepframe, the next update will contain the new buffer contents. โ ๏ธ - flag:
TARGET_BLOCKADOPTprevents the engine from preserving the target on calls tosystem_collapseor on script-error recovery. ๐ - flag:
TARGET_DRAINQUEUEallows events coming from the frameserver to be queued directly into the script event handler without being multiplexed on the master queue. This is a complex operation mainly intended for more trusted clients that act as protocol bridges or external input drivers where a higher event dispatch rate and lower event dispatch latency might be beneficial. ๐
๐ EXAMPLE ๐
hereโs the whole vibe in code:
function target_flags0()
a = launch_avfeed("", "avfeed", function(source, status)
for k,v in pairs(status) do
print(k, v);
end
end);
target_flag(a, TARGET_VERBOSE);
target_flag(a, TARGET_SYNCHRONOUS);
target_flag(a, TARGET_NOALPHA);
target_flag(a, TARGET_AUTOCLOCK);
target_flag(a, TARGET_NOBUFFERPASS);
end
๐ MISUSE ๐
bestie, this one is in the misuse section for a reason โ donโt copy it into real code:
function target_flags0()
a = null_surface(64, 64);
target_flag(a, FLAG_SYNCHRONOUS);
end
๐ MISUSE (again) ๐
and hereโs the second misuse moment, no cap:
function target_flags1()
a = launch_avfeed("", "avfeed", function() end);
target_flag(a, 10000);
end
๐ SEE ALSO ๐
targetcontrol
thatโs the whole page, bestie ๐ footer credits go to targetcontrol, October 2026. mwah ๐
๐ฆ 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