Skip to main content

Module layout

Module layout 

Source
Expand description

Offsets into the packed layout, matching the shader’s declaration.

Public because it is a contract between the shader and every backend, not an internal detail. Both backends copy the packed floats straight into a uniform buffer, so a member is found by its offset here rather than by a name – and naming the offsets in one place keeps the layout from being written out again as bare indices that quietly go stale when it grows.

Constants§

DITHER
The dither amplitude, and whether the target encodes on write.
FILTER
A color filter’s matrix, by column.
FILTER_OFFSET
The constant a color filter adds.
FILTER_PARAMS
Which color filter, if any, and in which form its matrix is stated.
GEOMETRY
Endpoints, or center plus angles.
OFFSETS
Stop positions.
PARAMS
Stop count, material kind, and two floats whose meaning the kind decides – a corner radius, a stroke width, a blur’s deviation, a gradient’s tile mode, a conical gradient’s separation.
STOPS
Four stop colors.
TO_LOCAL
Clip space to the paint’s own space: three columns of a three-by-three, in column order, each padded to four floats.