     }
     
     func encoder(width: Int, height: Int) throws -> Encoder {
-        guard let commandBuffer = queue.makeCommandBuffer() else { throw Error(description: "MTLCommandQueue.makeCommandBuffer failed.") }
-        return Encoder(width: width, height: height, renderer: self, commandBuffer: commandBuffer)
+        return Encoder(width: width, height: height, renderer: self)
     }
 }
 

        
        var stencil_buffer: MTLBuffer?
        
        init(width: Int, height: Int, renderer: MetalRenderer<Model>, commandBuffer: MTLCommandBuffer) {
            self.width = width
            self.height = height
            self.renderer = renderer
            self.commandBuffer = commandBuffer
        }
        
        deinit {

    
    private func check_limit() throws {
        
        if let commandEncoder = self.commandEncoder {
            
            guard command_counter >= command_encoder_limit else { return }
            
            commandEncoder.endEncoding()
            commandBuffer?.commit()
            commandBuffer?.waitUntilScheduled()
            
            self.commandEncoder = nil
            commandBuffer = nil
            command_counter = 0
            
            guard let _commandBuffer = renderer.queue.makeCommandBuffer() else { throw MetalRenderer.Error(description: "MTLCommandQueue.makeCommandBuffer failed.") }
            self.commandBuffer = _commandBuffer
            
        } else {
            
            guard let _commandBuffer = renderer.queue.makeCommandBuffer() else { throw MetalRenderer.Error(description: "MTLCommandQueue.makeCommandBuffer failed.") }
            self.commandBuffer = _commandBuffer
        }
    }
    
    private func makeBlitCommandEncoder() throws -> MTLBlitCommandEncoder {
