hal/shader/tests.lisp
Replacement emits REMOVE-METHOD and ADD-METHOD on the pinned SBCL/Closer-MOP stack. Consumers see their coalesced revision.
Two parameter aliases and two lexical let* bindings remain typed
objects. Only computed locals need entry-block declarations.
The map's answer is taken only where the surface faces the light; a surface turned away is lit by nothing, so it is also shadowed by nothing. #0604PY
vec3 has no interface declaration to predeclare its type. Assembly is
therefore the direct proof that the type and its first value received
distinct result IDs.
Semantic checking is a source concern; it does not perturb the SPIR-V representation or the deterministic lowering of valid arithmetic.
interpret can name checked arithmetic, but cannot smuggle meaning onto
a raw input. assume-quantity is the deliberately loud boundary for it.
Identical member order and offsets at binding 2 are the ABI contract which lets one buffer feed the vertex and fragment halves of both the block material and the sky.
The sky drops out of the checked-quantity world once, deliberately, and is ordinary image mathematics over a unit view ray thereafter.
A deck is a coverage threshold over one noise field, and the width of that threshold is the only thing that softens toward the horizon.
The deck's own shadow is the same field sampled along the deck toward the sun, against the same threshold: a lit face and a dark underside from one extra tap.
All the fragment's extended mathematics shares one import.
Below the horizon the sky stands in for terrain too far off to be resident, so the two stages have to arrive at the same colour or the edge of the resident world draws itself as a line. They agree by calling the same function on the same lanes rather than by two expressions kept in step by hand.
And the fog it feeds is still an absolute colour, mixed by the same amount the vertex stage measured.
Every extended operator in one module shares a single import, which sits in SPIR-V logical layout between capability and memory model.
Deterministic lowering, and no import where no extended math occurs.
Zero is deliberately in the non-positive class.
Horizontal ray bands omit horizontal curves.
Descending maximum x supports the shader's early exit.
The first curve's p3 is the following curve texel's p1.
Four headers, then the two vertical sides once (both horizontal bands hold exactly them, so the second points at the first's list) and the two horizontal sides once, likewise shared.
A square's two vertical sides fall in every horizontal band however many there are, so one band per axis is as good as any and cheapest.
Two squares stacked with a gap: two horizontal bands each hold one square's sides (a load of two) where one band would hold four.
The test must be a boolean.
A two-by-one roundrect is one unit inside at its centre and exactly on its straight right edge.
Radius equal to both half-extents is the ordinary circle distance.
Excessive and negative radii are normalized at the semantic boundary.
o, ffi, c, e: the three source characters at byte cluster 1 become one glyph selected by HarfBuzz rather than three cmap lookups.
Vector values with scalar bounds are not silently splatted.
Unsigned traversal values do not leak into float-only operations.
Storage buffers and bit fields: the path a packed 64-bit site takes from a host array into a shader.
Bit fields never lower to bit-field instructions, which Vulkan limits to 32-bit operands, nor to 64-bit mask constants.
(name &key kind components non-negative-p
(character nil character-supplied-p))Define quantity NAME and any homogeneous COMPONENTS as members of KIND. NON-NEGATIVE-P declares a non-negative amount and defaults its character to :ABSOLUTE. CHARACTER may state :POINT, :ABSOLUTE, or :DIFFERENCE explicitly. Components inherit both.
The inner product of two vectors.
Constrain a quantity between compatible bounds.
Interpolate compatible quantities by a scalar amount.
Produce dimensionless progress across compatible edges.
Compare compatible quantities and produce dimensionless values.
Normalize a dimensionless vector.
Construct a meaningful literal.
State external meaning for a raw value.
Name a compatible derived quantity.
Expose a quantity's raw representation.
Convert a quantity to a compatible unit.
(operator context expression)Lower EXPRESSION into CONTEXT's target product and return its value. Target context deliberately precedes operator identity in method selection: an operator implemented only for one backend must not capture another backend's context before its source-located unsupported-operation method.
(target specification)Lower SPECIFICATION for TARGET without changing its source graph. TARGET participates in ordinary CLOS dispatch so each backend can own its structured product and source provenance. #JDLQPN
Logical negation of one test or raw truth value.
Logical conjunction of tests and raw truth values.
(name specification)(object)(form)(role stage)(role stage)(name parameters &body body)Define a reusable typed shader expression with ordinary source syntax. The body is parsed at each call site, so argument types and quantity meanings flow through the same operator protocol as handwritten shader expressions. LET* is lexical inside the function. The definition macro records source; its body does not…
Addition over compatible quantities.
Multiplication and scalar scaling.
(name parameters &body body)(name options &body body)Convert one scalar float or unsigned value to a 32-bit unsigned integer.
Load one exact two-dimensional texel at an unsigned integer coordinate.
Select and reorder vector components by a designator such as :XYZ or :RGB.
The non-negative remainder of integer division.
Division of two represented quantities.
Convert one scalar float or unsigned value to a 32-bit float.
(name &body fields)Test whether two compatible scalars are equal.
Convert one scalar float or unsigned value to a 64-bit unsigned integer.
Test whether one compatible scalar is less than another.
Read one indexed element of the task payload shared with a mesh shader.
(generic-function name specialized-lambda-list options &body body)Define a shader-producing method with ordinary DEFMETHOD identity. Calling the method reparses its small source form so changes to source-level abstractions participate in live rebuilding. Method replacement remains the role/stage identity watched by the MOP; abstraction revisions are tracked separately by live…
(generic-function arguments)(dependent)(dependent)Test whether one compatible scalar is at least another.
(expression)Reconstruct the compact mathematical form of EXPRESSION.
(dependent revision)Record that the consumer finished attempting REVISION. A newer concurrent notification remains pending.
(dependent)One top-level defining form of a source file.
(name)Return the live typed shader function named by NAME, or NIL.
(name options body)(specification)Reusable shader source parsed into the typed graph at each call site.
(definition)((name symbol) (type (eql 'arithmetic-operator)))An inspectable typed call whose body is inlined during backend lowering.
(specification)Subtraction or unary negation.
Test whether one compatible scalar is greater than another.
(name options &body body)Define NAME as a function that reparses its shader source on every call. Where DEFINE-SHADER parses once at load, this parses each time it is asked, so live named values (SHADER-SOURCE-VALUE) folded into the body are read afresh -- and noted in *SHADER-SOURCE-VALUE-REFERENCES* -- by every pipeline build, exactly as a…
(name lambda-list &body body)Define NAME as a source-level shader abstraction. The expansion body receives the destructured call operands and returns a raw shader source form made from core operators or other abstractions.
(operator)Whether OPERATOR names source vocabulary expanded before shader parsing.
(binding)(left right)(specification)One descriptor-backed uniform block with ordered, inspectable members.
(block)The host byte size implied by BLOCK's shader-visible vec4-lane layout. Hosts allocating a backing buffer should derive their size here rather than repeating the lane arithmetic as a literal.
(name)Return the live arithmetic definition named by NAME, or NIL.
(specification)(left right)A virtual sampling product projected from a homogeneous map application.
How the children of a list are arranged.
(layout positions)A four-row homogeneous map with a separately checked sampling projection.
(left right)(expression)(expression)Whether semantic quantity checking is active at EXPRESSION. Annotations enter checked arithmetic; an explicit REPRESENTATION boundary leaves it again while retaining the semantic operand in the expression graph.
(expression)Whether EXPRESSION directly denotes one lowerable represented value.
Logical disjunction of tests and raw truth values.
An explicit exposure of a semantic value's raw machine representation.
(expression)The immediate subexpressions EXPRESSION computes from.
Apply a named projective map to a semantic affine point.
Project a homogeneous map application into its declared sampling product.
(instruction-or-class)The homogeneous result of applying a represented semantic map.
(expression)(object)Lower one structured shader object to a list of instruction instances.
A MuPDF context: its allocator, its store, and its error stack.
(context name)Sample a two-dimensional texture through a sampler at a UV coordinate.
The maximum of compatible quantities.
The componentwise absolute value of a raw value.
An explicit assumption that an opaque represented value has a meaning.
A checked semantic name for a represented value, with no codegen effect.
An explicitly meaningful value constructed from semantically raw source.
One inspectable environment light, packed into raw per-frame GPU lanes.
(declaration)Return DECLARATION's backend or Common Lisp representation type, or NIL.
(declaration)Return DECLARATION's homogeneous quantity specification, or NIL.
(declaration)An explicit linear unit conversion that may emit numerical scaling.
(expression)(unit)(specification)(name &key (dimension nil dimension-supplied-p) unit
(tensor-order 0)
(affine-p nil affine-p-supplied-p)
(character nil character-supplied-p))(specification)Whether SPECIFICATION's named definition declares a non-negative amount. Only a named absolute can promise this; anonymous derived results never do.
(operator)Whether OPERATOR names an operator of the shader language. Membership is an open set of EQL methods: DEFINE-SHADER-OPERATOR admits a name, and the operator's behavior arrives as further EQL methods on PARSE-SHADER-OPERATOR-CALL, INFER-SHADER-CALL-TYPE, and LOWER-SHADER-CALL.
(instruction)Raise a dimensionless value to a dimensionless power.
The componentwise square root of a raw value.
The minimum of compatible quantities.
(y1 y2 y3)Return the two Slug root-eligibility bits as numeric masks. Only strict positivity matters. The arithmetic form is Table 1 of Lengyel's 2017 paper without an integer lookup, and is the form generated into the proof pixel shader. #S2F8SA
(x1 y1 x2 y2)(start end)(left bottom right top &key clockwise-p)(curve axis)(curve axis)(curve axis)(outline &key horizontal-band-count vertical-band-count)Build conservative, sorted horizontal and vertical Slug curve bands. A band count left unspecified is chosen per axis by CHOOSE-SLUG-BAND-COUNT.
(contour)Test whether one compatible scalar is at most another.
(outline)(outline &key horizontal-band-count vertical-band-count)(serialized)(serialized)Whether a band whose sorted curve list is a contiguous run of a list already written points into that list instead of writing its own. The reference recommends it: adjacent bands often hold the same curves, and the sharing shrinks the band texture and keeps the texel cache warm.
(curves membership-axis minimum maximum
&optional (maximum-count *slug-maximum-band-count*))The fewest bands in [1, MAXIMUM-COUNT] that minimize the most curves any one band holds: the reference's advice for choosing a glyph's band counts, with ties going to the cheaper header block.
The most bands an axis may be cut into when the count is chosen automatically. The reference's format allows 256; more bands cost header texels and, past a point, only overlap epsilon.
(character font-loader)One inspectable application of shared function source to checked values.
A checked arithmetic source definition awaiting an execution backend.
(name)Notify loaded realizations that reusable arithmetic source changed.
(specification)Render one connected four-quadratic contour with Slug's two-ray pixel math. This is a typed shader function: its LET* bindings and nested calls are parsed directly into shader objects. The fixed curve count remains an atelier proof, not the band-texture font renderer. #OWR8OZ
(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
Read one indexed element of a storage buffer resource.
Extract the unsigned bit field (BYTE SIZE POSITION) of one unsigned scalar.
(resources body)One descriptor-backed read-only array of uniformly typed elements. The array has no declared length: a shader indexes it with BUFFER-ELEMENT and the host decides how many elements it uploads. #HFX2LI
(designator &optional source-form)Intent: #X9Q2YS removed the field-wide receiver-plane acne and left cast shadows shimmering anyway. Play reported the residue as worst near noon, which is a strong clue: a defect with a preferred hour has a mechanism that depends on the sun's elevation. Evidence: – A frozen-sun, frozen-camera control over 20 frames…
Shader operators are identified by symbol, so specification bodies written here must use the shader language's own words.