             -1.0,   1.0,  1.0, 0.0,
             1.0,  -1.0,  0.0, 1.0,
             -1.0,   1.0,  1.0, 0.0,
-            1.0,   1.0,  1.0, 1.0]
+            1.0,   1.0,  1.0, 1.0
+        ]
         
         // set up vertex buffer
         let dataSize = data.count * sizeofValue(data[0]) // 1
-        
-        var options:MTLResourceOptions!
-        
-        options = MTLResourceOptions.StorageModeShared.union(MTLResourceOptions.CPUCacheModeDefaultCache)
-        
-        _vertexBuffer = _device!.newBufferWithBytes(data, length: dataSize, options: options)
+        let options = MTLResourceOptions.StorageModeShared.union(MTLResourceOptions.CPUCacheModeDefaultCache)
+        _vertexBuffer = device.newBufferWithBytes(data, length: dataSize, options: options)
 
         // set vertex indicies start for each rotation
         _vertexStart[.LandscapeRight] = 0

    
    private var _vertexDesc: MTLVertexDescriptor! = nil
    
    private var _shaderLibrary: MTLLibrary! = nil
    private var _shaderDictionary: NSDictionary! = nil
    private var _shaderPipelineStates = [String : MTLRenderPipelineState]()

    private var _shaderArguments = [String : MTLRenderPipelineReflection]()
    
    private var _samplerStates = [MTLSamplerState]()
    

        
        
        // apply all render passes in the current filter
        if  let filterArgs = _filterArgs,
            let screenDescriptor = view.currentRenderPassDescriptor {
            
            let filterParameters = [filterArgs.bufferAndOffsetForElement(_currentFilterBuffer)]
            for (_, filter) in _currentVideoFilter.enumerate() {
                createRenderPass(commandBuffer,
                                 pipeline: filter,
                                 vertexIndex: 0,
                                 fragmentBuffers: filterParameters,
                                 sourceTextures: [sourceTexture, blurTex, _rgbTexture],
                                 descriptor: destDescriptor,
                                 viewport: nil)
                
                swapTextures()
            }
            
            createRenderPass(commandBuffer,
                             pipeline: invertScreen ? _screenInvertState! : _screenBlitState!,
