A .metallib function list's TYPE tag of 6, 7 or 8 answered Visible. Apple's
compiler writes 6 for an intersection function, 7 for a mesh function and 8 for
an object function, and Metal answers MTLFunctionTypeIntersection, Mesh and
Object for them (measured on the AMD 5300M and Intel 630 under macOS 26.7.1,
oracle_bundle functypes, and on the M3 Max by the shell test).
What the guest sees now: such a function's functionType is its stage's. A
[[visible]] or [[stitchable]] function (tag 4) still answers Visible, and the
test library gains one function of each of these stages.
patchType answered MTLPatchTypeNone and patchControlPointCount 0 for every
function, where Metal answers a post-tessellation vertex function's [[patch]]
type and count, and -1 for the count of every function that states none. The
device draws patches, so an app that fills its tessellation state from the
function built a wrong pipeline.
The library now reads each function's TESS tag from the .metallib's function
list: the type in its low two bits, the count above them, 63 for none, as
Apple's compiler writes it and as Metal's own functions answer for those bytes
on the M3 Max, the AMD 5300M and the Intel 630. A shell test checks both
answers against Metal's for a library of every patch kind (aud-tests-02).