hal/vulkan/spir-v/lowering.lisp
The OpTypeVector of count booleans: a vector select's condition.
Array lengths are type operands, so keep their constants directly beside the derived type instead of in the later value-constant section.
Return the id of buffer's block struct: one runtime array of elements.
Return an internal unsigned constant used for structural addressing.
Return the module's single GLSL.std.450 import id, requesting it once.
Modules whose expressions use no extended mathematics never acquire one.
SPIR-V 1.4 modules list every global the entry point touches.
The noun naming operator's SSA results in lowered provenance.
The default noun naming expression's lowered results.
Types own their canonical names. Claim the result type before deriving a
value name: a first-use constructor such as (vec3 0 0 0) otherwise lets
both its type and its value independently choose %VEC3.
The SPIR-V instruction computing one binary step of operator.
Emit one GLSL.std.450 operation, keyed by its enumerated instruction name.
Lower expression as one extended instruction over its lowered operands.
Fold expression's operands left to right through a binary extended step.
Fold expression's operands left to right through its binary operator.
Left-align the field, then right-align it: two logical shifts by 32-bit amounts extract any field of a 32- or 64-bit value without bit-field instructions, which Vulkan restricts to 32-bit operands, and without wide mask constants. A run-time position subtracts itself from the constant left shift.
Emit the target contribution first to retain the arithmetic ordering of luvcraft's original pointful shader.
Lower application once and return its four homogeneous components.
Project one homogeneous application into represented sample components.
Lower expression into instructions and return its value id.
OpSelect took one boolean per component until SPIR-V 1.4 relaxed it, and a stage's module version is not this expression's business, so a scalar condition choosing between vectors is splatted rather than leaned on: the wider form is valid at every version.
The index and state phis are prepended to the header once the back edge is known, so an :UNTIL test lowered here may already refer to them through the fold values.
Lower one semantic shader effect into SPIR-V control/data flow.
Lower specification and retain bidirectional expression/instruction links.
LET* is part of the language contract, not merely pretty syntax. Emit binding computations in source order so the resulting basic block reads alongside the specification and retains ordinary Lisp evaluation order.
The StorageBuffer storage class is core from SPIR-V 1.3; the 1.0 modules of ordinary stages must ask for it.
(context label)A MuPDF context: its allocator, its store, and its error stack.
(name)Logical disjunction of tests and raw truth values.
(name)(context name)(context name)Test whether two compatible scalars are equal.
(slot context form)(context type)Headings, paragraphs, figures and their IDs, mentions, marks.
(designator &optional source-form)(left right)(context)(context)(context count)(context storage-class value-type)(context storage-class value-id name)(context element-type element-count)(context block)(object)(context block)(context buffer)(context buffer)(value)(context value &optional expression)(context expression instruction)(form)(context value)(context texture-type)A simple Org table without formulas.
(context)Return the module's single GLSL.std.450 import id, requesting it once. Modules whose expressions use no extended mathematics never acquire one.
A durable OpExtInstImport: one named instruction set the module uses. Extended operations reference its result id, so repeated operators in one module share a single import.
(context declaration)PROPERTY: VALUES; -- the property a keyword, the values a list written space-separated.
One descriptor-backed uniform block with ordered, inspectable members.
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
A descriptor resource and, for textures, the represented meaning and colour transfer of the value returned by sampling.
(context declaration workgroup-size)(context payload)(context payload)(mesh-output per-primitive-p)(context declaration mesh-output per-primitive-p)(context mesh-output)(topology)(context expression form)(context expression source-expression)(operator)The noun naming OPERATOR's SSA results in lowered provenance.
Addition over compatible quantities.
Subtraction or unary negation.
Multiplication and scalar scaling.
Division of two represented quantities.
(expression)The default noun naming EXPRESSION's lowered results.
(reference)An inspectable typed call whose body is inlined during backend lowering.
A typed value conditional from the shared language.
The homogeneous result of applying a represented semantic map.
A virtual sampling product projected from a homogeneous map application.
A checked semantic name for a represented value, with no codegen effect.
An explicitly meaningful value constructed from semantically raw source.
Construct a meaningful literal.
An explicit assumption that an opaque represented value has a meaning.
An explicit exposure of a semantic value's raw machine representation.
Expose a quantity's raw representation.
(expression)(expression)(context expression type instruction operands)(context expression)(binding)(context expression)One scalar/vector field or fixed array in a task payload ABI.
A named value inside a SHADER-UNIFORM-BLOCK, not a separate resource.
A represented shader value with optional backend-neutral semantic meaning.
Logical conjunction of tests and raw truth values.
(operator left-type right-type)The SPIR-V instruction computing one binary step of OPERATOR.
(context expression operator result-type left-id left-type right-id right-type)(context expression type instruction-name operands)(instruction-or-class)(context expression instruction-name)(context expression instruction-name)(context expression)(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.
(expression)The non-negative remainder of integer division.
Extract the unsigned bit field (BYTE SIZE POSITION) of one unsigned scalar.
Test whether one compatible scalar is less than another.
(operator operand-type)Test whether one compatible scalar is at most another.
Test whether one compatible scalar is greater than another.
Test whether one compatible scalar is at least another.
(operator)Interpolate compatible quantities by a scalar amount.
The inner product of two vectors.
(definition context application &optional origin)Lower APPLICATION once and return its four homogeneous components.
One top-level defining form of a source file.
A four-row homogeneous map with a separately checked sampling projection.
(definition context projection)Project one homogeneous application into represented sample components.
(context expression projection indices)Select and reorder vector components by a designator such as :XYZ or :RGB.
(designator source-form)(expression)Return the virtual sampling projection denoted by EXPRESSION, or NIL.
(context expression)Convert one scalar float or unsigned value to a 32-bit unsigned integer.
(type)Convert one scalar float or unsigned value to a 64-bit unsigned integer.
Convert one scalar float or unsigned value to a 32-bit float.
The minimum of compatible quantities.
The maximum of compatible quantities.
The componentwise absolute value of a raw value.
The componentwise square root of a raw value.
Keyword/value pairs stay together; in body position each pair is a row with keys loosely aligned. A SETF with several pairs is a place/value table: each pair a subgrid row of its two-column box.
Raise a dimensionless value to a dimensionless power.
Constrain a quantity between compatible bounds.
Produce dimensionless progress across compatible edges.
Compare compatible quantities and produce dimensionless values.
Normalize a dimensionless vector.
Sample a two-dimensional texture through a sampler at a UV coordinate.
Load one exact two-dimensional texel at an unsigned integer coordinate.
Compare a depth reference through a comparison sampler at a UV coordinate.
(context expression)Lower EXPRESSION into instructions and return its value id.
(literal)A typed bounded fold lowered as structured target control flow.
(expression)An explicit linear unit conversion that may emit numerical scaling.
(expression)(expression)(context statement)Lower one semantic shader effect into SPIR-V control/data flow.
(context declaration index expression storage-class)(topology)(specification main-id)(specification)(expression)Whether EXPRESSION directly denotes one lowerable represented value.
Logical negation of one test or raw truth value.
(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
(specification)(specification)(module)
SPIR-V lowering for luv's typed shader graph.
The source language and its generic lowering protocols live in
luv.SHADER; this sibling owns only the SPIR-V construction context and result product.