title: Streaming vertices with asynchronous buffer uploads
body: <p>I've done some some research on streaming vertices, and I've found four ways to upload asynchronously (I think).</p>
  
  <p>Orphaning approaches:</p>
  
  <ul>
  <li><p>Before every write, create new storage for the buffer with
  glBufferData, then efficient write to it with glmapbuffer
  /glunmapbuffer</p></li>
  <li><p>Before you write with glmapbuffer, use the<br>
  GL_MAP_INVALIDATE_BUFFER_BIT flag to indicate that the implementation
  MAY create new storage. In practice, this does same thing as<br>
  orphaning with glbufferdata</p></li>
  </ul>
  
  <p>Other approaches:</p>
  
  <ul>
  <li><p>Use GL_MAP_UNSYNCHRONIZED_BIT with glmapbuffer to force asynchronous
  writes to same buffer that the GPU may be reading from. You promise
  not to write at the same location that reads are happening from or
  you get undefined behaviour. I guess the way you would use this is by
  constantly alternating writing to one side of the buffer, and then
  having gpu read the side thats not being written to.</p></li>
  <li><p>Use double buffering: create 2 VBOs. Alternate which one is written<br>
  to and which one is read from. Use glmapbuffer to read / write from<br>
  them efficiently. Bind the correct VBO to your VAO for drawing each time. Should be asynchronous.</p></li>
  </ul>
  
  <p>Please tell me if I said something wrong.</p>
  
  <p>I'd like to know, which is the most advisable to use. I do care about performance. The orphaning approaches seem like they would be expensive because all the allocations / deallocations. Double buffering seems like the best because it wont have allocation costs (right?) and it's not as complicated as the third approach.</p>