title: Renderpass Descriptor in Metal
body: <p>I am new to Metal. How many MTLRenderpassdescriptor we can create in a single Application any limit ?</p>
  
  <p>I want to have three MTLRenderpassdescriptor is it possible. One I need to draw quads according to finger position. It is like Offscreen Rendering. There will be texture output.</p>
  
  <p>I want to pass the output texture to another renderpass descriptor to process the color of it which is also similar to Offscreen Rendering.Here new output texture will be available</p>
  
  <p>I want to present new output Texture to the  screen. Is it Possible ? When I create three renderpass descriptors only two is available.</p>
  
  <p>First offscreen rendering It works fine</p>
  
  <pre><code>let renderPass = MTLRenderPassDescriptor()
  
  renderPass.colorAttachments[0].texture = ssTexture
  renderPass.colorAttachments[0].loadAction = .clear
  renderPass.colorAttachments[0].clearColor = MTLClearColorMake(  0.0,  0.0,  0.0,  0.0)
  renderPass.colorAttachments[0].storeAction = .store
  let commandBuffer = commandQueue.makeCommandBuffer()
  
  var commandEncoder = commandBuffer?.makeRenderCommandEncoder(descriptor: renderPass)
  for scene in scenesTool{
      scene.render(commandEncoder: commandEncoder!)
  }
  commandEncoder?.endEncoding()
  </code></pre>
  
  <p>This renderpass descriptor is not available in Debug as well.</p>
  
  <pre><code>let renderPassWC = MTLRenderPassDescriptor()
  renderPassWC.colorAttachments[0].texture = ssCurrentTexture
  renderPassWC.colorAttachments[0].loadAction = .clear
  renderPassWC.colorAttachments[0].clearColor = MTLClearColorMake(  0.0,  0.0,  0.0,  0.0)
  renderPassWC.colorAttachments[0].storeAction = .store
  
  let commandBufferWC = commandQueue.makeCommandBuffer()
  let commandEncoderWC = commandBufferWC?.makeRenderCommandEncoder(descriptor: renderPassWC)
  for scene in scenesWCTool{
      print(" msbksadbdksabfkasbd")
      scene.render(commandEncoder: commandEncoderWC!)
  }
  
  commandEncoderWC?.endEncoding()
  </code></pre>
  
  <p>Third Renderpass Descriptor is working Fine.</p>
  
  <pre><code>let descriptor = view.currentRenderPassDescriptor
  commandEncoder = commandBuffer?.makeRenderCommandEncoder(descriptor: descriptor!)
  
  for x in canvasTemporaryScenes{
      x.updateCanvas(texture: ssTexture!)
      x.render(commandEncoder: commandEncoder!)
  }
  
  commandEncoder?.endEncoding()
  guard let drawable = view.currentDrawable else { return }
  commandBuffer?.present(drawable)
  commandBuffer?.commit()
  commandBuffer?.waitUntilCompleted()
  </code></pre>