             desc.rasterizationEnabled = true
         }
         if let depthPixelFormat = elem.attributes["depth-attachment-pixel-format"] {
-            let mtlEnum = descriptorManager.mtlEnums["mtlPixelFormat"]!
-            let enumVal = UInt(mtlEnum.getValue(depthPixelFormat))
+            let mtlEnum = container.resolve(S3DMtlEnum.self, argument: "mtlPixelFormat")!
+            let enumVal = mtlEnum.getValue(depthPixelFormat)
             desc.depthAttachmentPixelFormat = MTLPixelFormat(rawValue: enumVal)!
         }
         if let stencilPixelFormat = elem.attributes["stencil-attachment-pixel-format"] {
-            let mtlEnum = descriptorManager.mtlEnums["mtlPixelFormat"]!
-            let enumVal = UInt(mtlEnum.getValue(stencilPixelFormat))
+            let mtlEnum = container.resolve(S3DMtlEnum.self, argument: "mtlPixelFormat")!
+            let enumVal = mtlEnum.getValue(stencilPixelFormat)
             desc.stencilAttachmentPixelFormat = MTLPixelFormat(rawValue: enumVal)!
         }
         

        let vertexAttrDesc = MTLVertexAttributeDescriptor()
        
        if let format = elem.attributes["format"] {
            let mtlEnum = descriptorManager.mtlEnums["mtlVertexFormat"]!
            let enumVal = UInt(mtlEnum.getValue(format))
            vertexAttrDesc.format = MTLVertexFormat(rawValue: enumVal)!
        }
        if let offset = elem.attributes["offset"] {

        //TODO: resourceOptions is option set type
        // texDesc.resourceOptions?  optional?  set later?
        if let cpuCacheMode = elem.attributes["cpu-cache-mode"] {
            let mtlEnum = container.resolve(S3DMtlEnum.self, argument: "mtlCpuCacheMode")!
            let enumVal = mtlEnum.getValue(cpuCacheMode)
            texDesc.cpuCacheMode = MTLCPUCacheMode(rawValue: enumVal)!
        }
        if let storageMode = elem.attributes["storage-mode"] {
            let mtlEnum = container.resolve(S3DMtlEnum.self, argument: "mtlStorageMode")!
            let enumVal = mtlEnum.getValue(storageMode)
            texDesc.storageMode = MTLStorageMode(rawValue: enumVal)!
        }
//        if let usage = elem.valueForAttribute("usage") as? String {
