 			self.instanceUniforms = (0..<bufferCount).map { _ in
 				return device.makeBuffer(length: EffectRenderer.kMaxSimultaneousEffects * MemoryLayout<InstanceUniforms>.stride, options: .storageModeShared)!
 			}
+			self.renderLists = Array(repeating: ContiguousArray(), count: bufferCount)
 		} catch let error {
 			fatalError(error.localizedDescription)
 		}

}

class EffectRenderer {
	static let kMaxSimultaneousEffects = 8
	let device: MTLDevice
	let pipeline: MTLRenderPipelineState
	let instanceUniforms: [MTLBuffer]
	
	var runningEffects : [RegionEffect]
	var animating: Bool { get {
		return !runningEffects.isEmpty
	}}

			$0.startTime + $0.duration > Date()
		}
		
		renderLists[bufferIndex] = ContiguousArray(runningEffects.map { $0.primitive })
		var fx = Array<InstanceUniforms>()
		fx.reserveCapacity(runningEffects.count)
		for effect in runningEffects {
