For sharing GPU data without copying between processes we've typically been able to create an IOSurface in the client and specify kIOSurfaceIsGlobal
IOSurfaceRef foo = IOSurfaceCreate((CFDictionaryRef)@{(id)kIOSurfaceWidth: @512, (id)kIOSurfaceHeight: @512, (id)kIOSurfaceBytesPerElement: @4,
(id)kIOSurfaceIsGlobal: @YES});
then use IOSurfaceGetID to get a value to pass between processes which can then be turned back into an IOSurfaceRef
IOSurfaceID foo_id = IOSurfaceGetID(foo);
...
IOSurface foo2 = IOSurfaceLookup(foo_id);
the kIOSurfaceIsGlobal flag has been required to allow this getid/lookup to work between processes, but is marked as deprecated in 10.11
/ kIOSurfaceIsGlobal - CFBoolean If true, the IOSurface may be looked up by any task in the system by its ID. Dep recated in Mac OS X 10.11. */¬
99 extern const CFStringRef kIOSurfaceIsGlobal▸▸ ▸ ▸ ▸ IOSFC_AVAILABLE_BUT_DEPRECATED(__MAC_10_6, __MAC_10_11, __IPHONE_NA , __IPHONE_NA);¬
is there a future-proof way to share IOSurfaces between processes? fwiw, it always seemed scary to me from a security perspective that even specially created IOSurfaces might be globally findable by a uint_32 ID, but it is a very important way to prevent copying big video and data buffers and for splitting apart complex rendering between processes.