     }
     
     func setVideoFilter(filterPasses:[String], usesBlur:Bool = true) {
-        _currentVideoFilter.removeAll(keepCapacity: true)
         println("Setting filter...")
-        _currentVideoFilter.extend(filterPasses.map({self.cachedPipelineStateFor($0)!}))
+        _currentVideoFilter = filterPasses.map({self.cachedPipelineStateFor($0)!})
         _currentVideoFilterUsesBlur = usesBlur
     }
     

        setFilterBuffer()
        
        
        let sampler = MTLSamplerDescriptor()
        sampler.label = "nearest"
        _samplerStates.append(_device.newSamplerStateWithDescriptor(sampler))
        sampler.label = "bilinear"
        sampler.minFilter = .Linear
        sampler.magFilter = .Linear
        
        _samplerStates.append(_device.newSamplerStateWithDescriptor(sampler))


        

            
            // apply all render passes in the current filter
            let filterParameters = [_filterArgs.bufferAndOffsetForElement(_currentFilterBuffer)]
            for (i, filter) in enumerate(_currentVideoFilter) {
                createRenderPass(commandBuffer,
                    pipeline: filter,
                    vertexBuffers: passthroughParameters,
                    fragmentBuffers: filterParameters,
                    sourceTextures: [sourceTexture, blurTex, _rgbTexture],
