hal/shader/slug-cache.lisp
Reusable HarfBuzz results and exact Slug GPU outlines owned by one device.
Resolved font keys by the namestring asked for: TRUENAME is a few system calls and some consing, and is asked for once per glyph.
One parsed font per file for the whole process. Opening a TTF with ZPB-TTF reads and parses its tables, which is far too much to do per string per frame; the loader keeps its stream and is never closed.
The process-wide open ZPB-TTF loader for font-pathname.
HarfBuzz results for the whole process, by font key, string, and
direction. Shaping does not depend on the device, and measuring text
(text-size) happens with no device cache at hand, so one table serves all.
Return one durable HarfBuzz result for an exact font, string, and direction.
Return one durable HarfBuzz result for an exact font, string, and direction.
Pack resources into one RG16U band and one RGBA16F curve texture.
Join HarfBuzz placements to normalized Slug outlines by selected glyph ID.
Return normalized left, bottom, right, and top extents for glyphs.
Reusable HarfBuzz results and exact Slug GPU outlines owned by one device.
(device)Resolved font keys by the namestring asked for: TRUENAME is a few system calls and some consing, and is asked for once per glyph.
(font-pathname)Logical disjunction of tests and raw truth values.
(font-pathname)HarfBuzz results for the whole process, by font key, string, and direction. Shaping does not depend on the device, and measuring text (TEXT-SIZE) happens with no device cache at hand, so one table serves all.
((medium luv-gpu-medium) string &key text-style (start 0) end)(font-pathname string &key direction)(string font-pathname &key direction)Shape STRING with HarfBuzz, returning glyph IDs and font-unit placements. DIRECTION may be :LTR, :RTL, :TTB, or :BTT. With no direction HarfBuzz guesses the segment properties from the Unicode text. #4G7064
(cache font-pathname string &key direction)(key glyph-id font-loader)(glyph-index font-loader)(outline &key horizontal-band-count vertical-band-count)(cache font-pathname glyph-id font-loader)Logical negation of one test or raw truth value.
(resources count-reader data-reader element-type)The maximum of compatible quantities.
Addition over compatible quantities.
(cache key resources)(device descriptor)Asks the DEVICE for a handle to newly created instance of some object fulfilling the DESCRIPTOR.
(queue destination data data-layout size)Multiplication and scalar scaling.
(handle)Logically invalidate HANDLE immediately. Native teardown may be deferred until submitted work which captured HANDLE has completed.
(cache glyphs)(shaped font-loader cache font-pathname)Division of two represented quantities.
Test whether two compatible scalars are equal.
(draws shaped font-loader)The minimum of compatible quantities.
Device-owned Slug shaping, outline, and atlas resources.
slug-glyph-cacheis the semantic device boundary. It retains durable HarfBuzz results and normalized outlines, then packs the exact glyph set a run needs into shared RG16U/RGBA16F atlases. Screen and world renderers supply their own placement geometry around these reusable records.