     
     @IBOutlet weak var spectraView: Spectra.BaseView! //TODO: weak?
     var scene: Spectra.Scene?
+    var descMan: Spectra.SpectraDescriptorManager!
+    var stateMan: Spectra.SpectraStateManager!
     
     // i wish i could more strongly constrain the keys for these maps
     // - but i can't create a protocol for enums 

        setupScene()
    }
    
    func loadVertexDescriptorMap() {
        vertexDescriptorMap["common"] = VertexDescriptorGenerator.commonVertexDescriptor()
    }
    
    func loadPipelineStateMap() {
        let pipelineGenerator = Spectra.RenderPipelineGenerator(library: spectraView.defaultLibrary)
        pipelineStateMap = pipelineGenerator.generatePipelineMap(spectraView.device!, functionMap: CubeViewController.renderFunctionMap, setupDescriptor: { (desc) in
            desc.colorAttachments[0].pixelFormat = .BGRA8Unorm
            desc.vertexDescriptor = self.vertexDescriptorMap["common"]
            return desc
        })
    }
    
    func loadDepthStencilMap() {
        let depthStateDesc = MTLDepthStencilDescriptor()
        depthStateDesc.depthCompareFunction = .Always
        depthStateDesc.depthWriteEnabled = true
        depthStencilStateMap["default"] = spectraView.device?.newDepthStencilStateWithDescriptor(depthStateDesc)
    }
    
    func setupPerspective() {

//    }
    
    let cubeKey = "spectra_cube"
    var pipelineStateMap: Spectra.RenderPipelineStateMap = [:]
    var encodableDataMap: Spectra.SceneEncodableDataMap = [:]
    
    override func viewDidLoad() {
        super.viewDidLoad()
        stateMan = Spectra.SpectraStateManager()
        loadDescriptorManager()
        loadRenderPipelineStates()
        
        scene = Spectra.Scene()
        setupPerspective()
