hal/metal/iosurface.lisp
The CFStringRef constant name (kIOSurfaceWidth and friends) as a pointer.
'BGRA' as a four-character code.
Create a width x height IOSurface and return its raw IOSurfaceRef.
The caller owns one CF reference; release it with release-iosurface.
global-p (deprecated by Apple, still honoured) is what lets another process
find the surface by its integer ID with lookup-iosurface.
Return a new owned IOSurfaceRef for the surface numbered id, or NIL.
Run body with surface locked for CPU access to its base address.
The four bytes of the pixel at X, Y as a list, in memory order (BGRA).
Metal wraps a surface as a shared-storage texture.
Create one owned Metal texture whose storage is surface.
(name (selector result-type &key ownership class consumes-receiver)
&body arguments)(width height &key (bytes-per-element 4)
(pixel-format +iosurface-pixel-format-bgra+)
(global-p t))Create a WIDTH x HEIGHT IOSurface and return its raw IOSurfaceRef. The caller owns one CF reference; release it with RELEASE-IOSURFACE. GLOBAL-P (deprecated by Apple, still honoured) is what lets another process find the surface by its integer ID with LOOKUP-IOSURFACE.
(surface)(() &body body)((variable form) &body body)((surface &key read-only) &body body)(surface x y)Addition over compatible quantities.
Multiplication and scalar scaling.
(device surface pixel-format usage &key label)(&optional (stream *standard-output*))Logical conjunction of tests and raw truth values.
(string)Return an autoreleased NSString containing STRING. The result is borrowed and must remain inside its surrounding autorelease pool. Native APIs which copy an NSString argument may retain it beyond that scope in the ordinary Objective-C way.
IOSurface: a GPU-visible pixel buffer that survives a process boundary.
A surface created here has a small integer identity that any process on the machine can turn back into the same surface with IOSurfaceLookup, and Metal can wrap either end as an ordinary texture. That is the whole trick behind rendering one luvcraft inside another: the parent creates the surface, hands the child the number, and samples the texture the child draws into.