luft/render/instruments.lisp
Return instrument's input and visual stacking priority.
Whether instrument currently participates in viewer.
Publish instrument's already-owned state at viewer's frame boundary.
Encode instrument into viewer's final pass at physical-extent.
Release instrument while viewer's GPU device is live.
Return a priority-descending snapshot of viewer's instruments.
Run function at viewer's native frame boundary when one exists.
Before the canvas is open, and after it has quiesced, the caller still owns
the attachment list directly. An open canvas owns both mutation and release:
request-canvas-frame serializes this call after any frame which borrowed an
instrument snapshot and propagates function's values or condition back to the
caller.
Recheck under the registry lock so bare owners and same-object concurrent adds remain duplicate-free.
The registry consumes a newly offered instrument on success or rejection. Release on this same owner boundary so an opening constructor can unwind without stranding partial resources.
Attach instrument at viewer's frame boundary in explicit priority order.
ADD consumes a newly offered instrument on both success and terminal
rejection. Once viewer begins stopping, the rejected instrument is released
exactly once before application-attachment-closed is signalled.
A duplicate is already application-owned. Resolve it before asking a closing native canvas to run a callback, because pre-callback rejection must never release an object which remains in the viewer registry.
Preserve the application's semantic terminal rejection when the native canvas refuses the request before our callback.
A closing canvas may reject the owner request before the callback
starts. In that case the registry never consumed instrument, so no
frame can have borrowed it. GPU destroy remains safe on this caller:
backend retirement locks serialize it with terminal device teardown.
Detach and release instrument at a frame boundary.
Return true when it was attached. Release is synchronous with the caller and therefore cannot overlap a native frame which still borrows the instrument.
Refresh each present instrument outside the render-pass encoder.
Encode lower-priority instruments first and modal surfaces last.
Offer event from highest to lowest priority until one consumes it.
Atomically detach then release every instrument at a frame boundary.
This is deliberately the only application-level event wrapper. Individual
instruments add methods on handle-viewer-instrument-event, so independently
loaded adapters never replace one another at an identical method coordinate.
(viewer)Return VIEWER's live mutation owner, or NIL before native startup.
(viewer)Return VIEWER's terminal attachment gate, or NIL for a bare test owner.
(instrument)Return INSTRUMENT's input and visual stacking priority.
(instrument viewer)Whether INSTRUMENT currently participates in VIEWER.
(instrument viewer)Publish INSTRUMENT's already-owned state at VIEWER's frame boundary.
(instrument viewer pass surface-texture physical-extent)Encode INSTRUMENT into VIEWER's final PASS at PHYSICAL-EXTENT.
(instrument viewer canvas event)Handle EVENT for INSTRUMENT and return true when world input must stop.
A native destination with a lifetime and frame clock.
(instrument viewer)Release INSTRUMENT while VIEWER's GPU device is live.
(viewer)(instruments)Test whether one compatible scalar is greater than another.
(viewer function)Run FUNCTION at VIEWER's native frame boundary when one exists. Before the canvas is open, and after it has quiesced, the caller still owns the attachment list directly. An open canvas owns both mutation and release: REQUEST-CANVAS-FRAME serializes this call after any frame which borrowed an instrument snapshot and…
(canvas function)Run FUNCTION with a timestamp on CANVAS's native frame/event thread. The initial native implementation is synchronous: the caller waits for the function's values. The protocol leaves room for a real frame scheduler.
Logical conjunction of tests and raw truth values.
(viewer instrument)(protected-form &body cleanup-forms)(controller function &key attachment already-attached-p)Call quick publication FUNCTION iff CONTROLLER is still running. The controller lock remains held across FUNCTION, making publication atomic with the RUNNING to STOPPING transition. FUNCTION and ALREADY-ATTACHED-P must therefore neither block nor reenter CONTROLLER. A true ALREADY-ATTACHED-P is an idempotent…
(name &body body)(viewer instrument)Attach INSTRUMENT at VIEWER's frame boundary in explicit priority order. ADD consumes a newly offered INSTRUMENT on both success and terminal rejection. Once VIEWER begins stopping, the rejected instrument is released exactly once before APPLICATION-ATTACHMENT-CLOSED is signalled.
An application attachment was offered after terminal teardown began.
(controller)Logical negation of one test or raw truth value.
(handle)Logically invalidate HANDLE immediately. Native teardown may be deferred until submitted work which captured HANDLE has completed.
(viewer instrument)Test whether two compatible scalars are equal.
(viewer instrument)Detach and release INSTRUMENT at a frame boundary. Return true when it was attached. Release is synchronous with the caller and therefore cannot overlap a native frame which still borrows the instrument.
(viewer)(viewer pass surface-texture physical-extent)(viewer canvas event)(viewer)
A viewer instrument is a sparse application attachment: a metabar, M-x, inspector-like tool, or other developer surface which participates in the existing game presentation without owning another canvas or frame loop. Attachments are ordered once at the boundary; their dense GPU state remains inside their renderer or McCLIM compositor.