For a better explanation and implementation of this concept please see my new repo and corresponding tutorial.
Example implementation of a deferred lighting rendering technique in Swift using Apple's Metal API. Hacked together from Apple's "Adopting Metal I: A practical approach to your first Metal app" found here (Copyright (C) 2016 Apple Inc. All rights reserved.)
Please let me know if you find any issues!
Xcode 8.0 or later; OS X 10.12 SDK or later
OS X 10.12 or later
OSX_GPUFamily1_v1 or later