How ugly would the JAI code to need to be to interface with this?
I wish they had a simple Metal C API, but their new API comes with a bunch of Objective-C baggage.
How ugly would the JAI code to need to be to interface with this?
I wish they had a simple Metal C API, but their new API comes with a bunch of Objective-C baggage.
In Metal the Obj-C abstraction is part of the design and used to eliminate any other abstraction people would want to introduce. The objects you get back from the API are implemented straight in the GPU vendor code, and the debug tools can swap the methods out for extra validation, recording, etc.
If you're worried about refcounting, use ARC (which you have to with Swift anyway). First, the compiler is very smart about optimizing away retain/release/autorelease calls whenever it can. Second, when those calls do have to be made, they're implemented using vtables, and never hit objc_msgSend() in the first place.