mcclim/direct-compositor.lisp
A retained McCLIM command stream replayed into a caller-owned GPU pass.
The caller supplies one 4x4 clip-space affine state and the actual destination
texture for each frame. Semantic solids, analytic shapes, gradients, images,
lattices, and Slug text are evaluated at that texture's native resolution;
there is no pane raster, upload, sampled copy, drawable acquisition, or queue
submission in this compositor. Per-drawable uniform resources are keyed by
luv:canvas-frame-resource-key so multiple frames may remain in flight without
an unbounded cache of backend wrapper objects.
Direct McCLIM pipeline~P ~{~S~^, ~} ~ must be prepared before the application render pass opens (format ~S, depth ~S).
Resources borrowed together for one direct-widget command replay.
Logically release every GPU resource retained by overlay.
luv:destroy invalidates each wrapper now and defers native teardown through the
backend submission frontier when an in-flight command buffer still owns it.
Detach every logical owner before invoking user-visible destruction. One failing wrapper can therefore neither prevent later releases nor remain reachable for a second destructive pass.
Live images may retain the old raster-named :BEFORE adapter. It would release twice once the neutral primary below is installed.
Legacy adapter for callers compiled against the raster-era protocol name.
Return compositor's depth declaration for every semantic pipeline.
Project pane point U,V through state, retaining W,U,V for hit testing.
Set a conservative target-pixel scissor for pane-local clip.
Clipping belongs to the shared affine compositor: both a world panel and a HUD panel can rotate, scale, or project the same retained command stream.
Crossing the camera plane makes the projected AABB unbounded. The full target is the conservative answer.
Shape bindings also serve the application-specific chassis adapter and are the common affine ABI for every direct mirror.
Exhaustively release detached pipeline FAMILY states.
Compile only families, transactionally, before an application render pass.
Never publish a mixed cohort if source changed during a slow backend compilation. The old families remain good.
Assert that families were prepared before the caller opened its pass.
Legacy encode adapter: verify preparation without compiling in an open pass.
Prepare compositor's current semantic families outside a render pass.
A compositor is normally attached after the mirror's first repaint. This closes that seam without waiting for an application render pass.
Evict compositor's GPU state retained for one canvas frame-key.
The state and all bind groups which borrow its affine buffer are detached before any native resource is destroyed. Other drawable slots remain available.
Collect every cache entry which borrows FRAME-STATE before mutating a table. Common Lisp does not promise that REMHASH during MAPHASH is portable, and logical detachment must precede fallible destruction.
Return the bounded backend frame key for surface-texture.
Metal presents a stable drawable through a fresh Lisp texture wrapper each time. Keying by that wrapper leaks one uniform buffer and several bind groups per frame; the canvas context exposes the native drawable identity instead.
Upload revision once into frame-state's backend-bounded source slot.
Publish the pairing only after all six dense buffers contain revision.
Replay COMPOSITOR's textureless McCLIM mirror into PASS under affine STATE.
DESTINATION-TEXTURE describes the open pass for format and clipping. FRAME-TEXTURE names the bounded in-flight presentation slot whose host-visible buffers are safe to update; normally both arguments are the same texture.
This is a guard only. Compilation belongs to mirror publication or
prepare-direct-gpu-mirror, both outside the application's open pass.
A retained McCLIM command stream replayed into a caller-owned GPU pass. The caller supplies one 4x4 clip-space affine state and the actual destination texture for each frame. Semantic solids, analytic shapes, gradients, images, lattices, and Slug text are evaluated at that texture's native resolution; there is no…
(context surface-texture)Return the stable presentation slot key for SURFACE-TEXTURE in CONTEXT. Applications use this to retain per-frame resources without assuming that a backend returns the same Lisp wrapper every time it revisits a native drawable.
Resources borrowed together for one direct-widget command replay.
(compositor command)Whether COMPOSITOR wants prepared COMMAND in the mirror texture. A compositor which replays a command directly into its final render pass can return false, avoiding a lower-resolution copy underneath the direct draw.
(name options &body body)Select and reorder vector components by a designator such as :XYZ or :RGB.
Addition over compatible quantities.
Multiplication and scalar scaling.
(overlay)Logically release every GPU resource retained by OVERLAY. LUV:DESTROY invalidates each wrapper now and defers native teardown through the backend submission frontier when an in-flight command buffer still owns it.
(handle)Logically invalidate HANDLE immediately. Native teardown may be deferred until submitted work which captured HANDLE has completed.
A simple Org table without formulas.
(dependent)(compositor)Exhaustively release resources retained by a mirror COMPOSITOR.
(compositor)Legacy adapter for the application-neutral RELEASE-MIRROR-COMPOSITOR.
(compositor)Return COMPOSITOR's depth declaration for every semantic pipeline.
(pass compositor mirror surface-texture clip)(state width height u v)Subtraction or unary negation.
Division of two represented quantities.
(mirror)Logical negation of one test or raw truth value.
Logical conjunction of tests and raw truth values.
(pass-encoder x y width height)Logical disjunction of tests and raw truth values.
The maximum of compatible quantities.
The minimum of compatible quantities.
(generic-function arguments)(role stage)Return the current durable shader specification for ROLE and STAGE.
(compositor)(dependent)(compositor device)How the children of a list are arranged.
(device descriptor)Asks the DEVICE for a handle to newly created instance of some object fulfilling the DESCRIPTOR.
(compositor device)(compositor device)(compositor device)(compositor device family)(compositor family)(compositor family target-format depth-stencil
source-revision solid-fragment-revision)(state family source-revision solid-fragment-revision)Test whether two compatible scalars are equal.
(compositor target-format depth-stencil families)(compositor target-format depth-stencil families)(compositor target-format depth-stencil families)(compositor target-format depth-stencil)(compositor &key
(revision
(alexandria:when-let
((mirror (widget-overlay-mirror compositor)))
(gpu-mirror-prepared-revision mirror)))
target-format
(depth-stencil
(direct-gpu-mirror-depth-stencil compositor)))A MuPDF context: its allocator, its store, and its error stack.
(compositor mirror revision)Prepare COMPOSITOR for immutable MIRROR REVISION outside a render pass.
(compositor mirror revision &key target-format depth-stencil)Prepare COMPOSITOR for REVISION and an application-owned attachment. This target-aware protocol is used when the application renders a retained mirror somewhere other than its canvas format. The default preserves the ordinary revision protocol for compositors without target-specific state.
((agent application-agent) &key)(compositor frame-key)Evict COMPOSITOR's GPU state retained for one canvas FRAME-KEY. The state and all bind groups which borrow its affine buffer are detached before any native resource is destroyed. Other drawable slots remain available.
(overlay surface-texture)Return the bounded backend frame key for SURFACE-TEXTURE. Metal presents a stable drawable through a fresh Lisp texture wrapper each time. Keying by that wrapper leaks one uniform buffer and several bind groups per frame; the canvas context exposes the native drawable identity instead.
(overlay surface-texture)(compositor frame-state revision)(overlay paint frame-state)(overlay paint frame-state)(overlay atlas frame-state)(command pass frame-state)Encode one prepared COMMAND into PASS using destination FRAME-STATE. Dispatch is at command grain. Vertex and texture payloads remain in the dense buffers owned by FRAME-STATE.
(pass pipeline bind-group buffer first-vertex vertex-count)(name-and-options lambda-list &body body)Define a function whose complete dynamic extent is an ambient trace zone. The inferred name is PACKAGE/FUNCTION. Use (NAME :ZONE ZONE-NAME) to provide a more semantic name and :VALUE FORM to attach a Tracy work count.
Replay COMPOSITOR's textureless McCLIM mirror into PASS under affine STATE. DESTINATION-TEXTURE describes the open pass for format and clipping. FRAME-TEXTURE names the bounded in-flight presentation slot whose host-visible buffers are safe to update; normally both arguments are the same texture.
Application-neutral retained McCLIM commands composed directly into a caller-owned GPU render pass. The implementation lives here so games can share semantic, target-resolution UI without depending on one another.