[swift-users] Design and performance of Vector2/3/4 and Matrix

Michael Gottesman mgottesman at apple.com
Fri Dec 18 17:46:29 CST 2015

> On Dec 18, 2015, at 5:13 PM, David Turnbull via swift-users <swift-users at swift.org> wrote:
> On Fri, Dec 18, 2015 at 2:31 PM, Janosch Hildebrand via swift-users <swift-users at swift.org <mailto:swift-users at swift.org>> wrote:
> You will also want to have this code in the same module that is using this type.
> If you're using these types from another module you're limited to unspecialized generics which are (unsurprisingly) very slow.
> This is becoming clear. Hopefully these patterns can be optimized across modules eventually. It's easy enough to write a pre-processor that expands the generics into four specializations. But it doesn't solve everything so not a priority.

We do want to be able to perform these sorts of optimizations (among others) across module boundaries. The reason that it has not been implemented yet is that the model for when/how one could (for instance) inline across module boundaries is not finalized. This will be possible once the resilience feature is complete.

> And since you probably need to drop generics anyway it might make sense to simply wrap the respective GLKit types on OS X and iOS for the GLFloat variants as they are already highly optimized. I have some wrappers for the GLKMatrix and GLKVector types lying around in my own OpenGL wrapper (incidentally also named SwiftGL ;-)) which might save you some typing if you're interested...
> I'm trailblazing cross-platform OpenGL in Swift. Given there's only one other platform, the key question is, "Does it work on Linux?"
> Is your SwiftGL online somewhere? A cursory search didn't yield anything. 
> -david (https://github.com/AE9RB/SwiftGL <https://github.com/AE9RB/SwiftGL>)
>  _______________________________________________
> swift-users mailing list
> swift-users at swift.org
> https://lists.swift.org/mailman/listinfo/swift-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20151218/18453160/attachment.html>

More information about the swift-users mailing list