title: Copy Metal frame buffer texture for reading
body: <p>I'm trying to take a screenshot of a MetalKit view (MTKView) like in the answer <a href="https://stackoverflow.com/questions/33844130/take-a-snapshot-of-current-screen-with-metal-in-swift">Take a snapshot of current screen with Metal in swift</a> but it requires that the MTKView set framebufferOnly to false which disables some optimizations according to Apple.</p>
  
  <p>Is there a way to copy the MTKView texture (e.g. view.currentDrawable.texture) so that I can read the pixels? I don't need to take screenshots often so it would be a shame to disable the optimization for the entire lifecycle of the program running. </p>
  
  <p>I tried using MTLTexture.newTextureViewWithPixelFormat and blit buffers but I still get the same exception about the frame buffer only being true.</p>