title: MetalKit - Drawable.texture assertion error
body: <p>I am new to <code>MetalKit</code> and trying to convert <a href="http://mhorga.org/2016/05/02/using-metalkit-part-10.html" rel="noreferrer">this tutorial</a> from <code>playground</code> back to <code>OSX</code> app:</p>
  
  <pre><code>    import MetalKit
  
  public class MetalView: MTKView {
  
      var queue: MTLCommandQueue! = nil
      var cps: MTLComputePipelineState! = nil
  
      required public init(coder: NSCoder) {
          super.init(coder: coder)
          device = MTLCreateSystemDefaultDevice()
          registerShaders()
      }
  
  
      override public func drawRect(dirtyRect: NSRect) {
          super.drawRect(dirtyRect)
          if let drawable = currentDrawable {
              let command_buffer = queue.commandBuffer()
              let command_encoder = command_buffer.computeCommandEncoder()
              command_encoder.setComputePipelineState(cps)
              command_encoder.setTexture(drawable.texture, atIndex: 0)
              let threadGroupCount = MTLSizeMake(8, 8, 1)
              let threadGroups = MTLSizeMake(drawable.texture.width / threadGroupCount.width, drawable.texture.height / threadGroupCount.height, 1)
              command_encoder.dispatchThreadgroups(threadGroups, threadsPerThreadgroup: threadGroupCount)
              command_encoder.endEncoding()
              command_buffer.presentDrawable(drawable)
              command_buffer.commit()
          }
      }
  
      func registerShaders() {
          queue = device!.newCommandQueue()
          do {
              let library = device!.newDefaultLibrary()!
              let kernel = library.newFunctionWithName("compute")!
              cps = try device!.newComputePipelineStateWithFunction(kernel)
          } catch let e {
              Swift.print("\(e)")
          }
      }
  }
  </code></pre>
  
  <p>I got an error at the line:</p>
  
  <pre><code>command_encoder.setTexture(drawable.texture, atIndex: 0)
  </code></pre>
  
  <blockquote>
    <p>failed assertion `frameBufferOnly texture not supported for compute.'</p>
  </blockquote>
  
  <p>How can I resolve this? </p>