     }
 }
 
+//class CircularBuffer: EncodableBuffer {
+//    
+//}
+
+// manages writing texture data
+//class TextureBuffer: SpectraBaseBuffer {
+//
+//}
+
+// highly performant buffer (requires iOS and CPU/GPU integrated architecture)
+// TODO: decide if generic is required?
+//@available(iOS 9.0, *)
+//class NoCopyBuffer<T>: EncodableBuffer {
+//    var stride:Int?
+//    var elementSize:Int = sizeof(T)
+//    private var bufferPtr: UnsafeMutablePointer<Void>?
+//    private var bufferVoidPtr: COpaquePointer?
+//    private var bufferDataPtr: UnsafeMutablePointer<T>?
+//    var bufferAlignment: Int = 0x1000 // for NoCopy buffers, memory needs needs to be mutliples of 4096
+//    
+//    func prepareMemory(bytecount: Int) {
+//        self.bytecount = bytecount
+//        bufferPtr = UnsafeMutablePointer<Void>.alloc(bytecount)
+//        posix_memalign(&bufferPtr!, bufferAlignment, bytecount)
+//        bufferVoidPtr = COpaquePointer(bufferPtr!)
+//        bufferDataPtr = UnsafeMutablePointer<T>(bufferVoidPtr!)
+//    }
+//    
+//    override func prepareBuffer(device: MTLDevice, options: MTLResourceOptions) {
+//        //TODO: common deallocator?
+//        buffer = device.newBufferWithBytesNoCopy(bufferPtr!, length: bytecount!, options: .StorageModeShared, deallocator: nil)
+//    }
+//    
+//    //TODO: decide on how to use similar data access patterns when buffer is specific to a texture
+//    //    override func initTexture(device: MTLDevice, textureDescriptor: MTLTextureDescriptor) {
+//    //        //        texture = texBuffer!.newTextureWithDescriptor(textureDescriptor, offset: 0, bytesPerRow: calcBytesPerRow())
+//    //    }
+//    
+//    //mechanism for writing specific bytes
+//    func writeBuffer(data: [T]) {
+//        memcpy(bufferDataPtr!, data, bytecount!)
+//    }
+//}


//static let baseBufferDefaultOptions = ["default": BufferOptions(index: 0, offset: 0) as! AnyObject]

//protocol EncodableInput {
protocol EncodableData {
    
    // the advantage of this interface is that buffers, inputs & groups are all accessable under the same interface

import Metal
import simd

struct InputParams {
    var index:Int
    var offset:Int = 0
