title: Multiple renders to single texture without blocking MTLCommandBuffer
body: <p>I am trying to render 3 separate things to one texture in Metal.
  I have a MTLTexture that is used as a destination in 3 different MTLCommandBuffers. I commit them one after another. Each MTLCommandBuffer renders to a separate part of the texture - first draws in the 0 - 1/3 part, second draws the middle 1/3 - 2/3 and the last one draws 2/3 - 1.</p>
  <pre><code>id&lt;MTLTexture&gt; dst_texture = ...;
  id&lt;MTLCommandBuffer&gt; buffer1 = [self drawToTexture:dst_texture];
  [buffer1 commit];
  id&lt;MTLCommandBuffer&gt; buffer2 = [self drawToTexture:dst_texture];
  [buffer2 commit];
  id&lt;MTLCommandBuffer&gt; buffer3 = [self drawToTexture:dst_texture];
  [buffer3 commit];
  </code></pre>
  <p>The problem is that it seems I can't <em>share</em> the destination texture in the different command buffers - I get glitches, sometimes I can see only partial results on the destination texture...
  Inside <code>drawToTexture</code> I use dst_texture this way:</p>
  <pre><code>_renderPassDescriptor.colorAttachments[0].texture = dst_texture;
  _renderPassDescriptor.colorAttachments[0].loadAction = MTLLoadActionLoad;
  </code></pre>
  <p>The problem gets fixed when I call <code>[buffer waitUntilCompleted]</code> after each individual commit but I suppose it affects the performance and I would love to have it without blocking/waiting.</p>
  <p>This works:</p>
  <pre><code>id&lt;MTLTexture&gt; dst_texture = ...;
  id&lt;MTLCommandBuffer&gt; buffer1 = [self drawToTexture:dst_texture];
  [buffer1 commit];
  [buffer1 waitUntilCompleted];
  id&lt;MTLCommandBuffer&gt; buffer2 = [self drawToTexture:dst_texture];
  [buffer2 commit];
  [buffer2 waitUntilCompleted];
  id&lt;MTLCommandBuffer&gt; buffer3 = [self drawToTexture:dst_texture];
  [buffer3 commit];
  [buffer3 waitUntilCompleted];
  </code></pre>
  <p>What else I could do here to avoid <code>waitUntilCompleted</code> calls?</p>