title: When should glInvalidateBufferData be used?
body: <p>OpenGL provides the functions <code>glInvalidateBufferData</code> and <code>glInvalidateBufferSubData</code> for invalidating buffers.</p>
  
  <p>What these functions do according to the OpenGL wiki:</p>
  
  <blockquote>
    <p>When a buffer or region thereof is invalidated, it means that the contents of that buffer are now undefined.</p>
  </blockquote>
  
  <p>and</p>
  
  <blockquote>
    <p>The idea is that, by invalidating a buffer or range thereof, the implementation will simply grab a new piece of memory to use for any later operations. Thus, while previously issued GL commands can still read the buffer's original data, you can fill the invalidated buffer with new values (via mapping or glBufferSubData) without causing implicit synchronization.</p>
  </blockquote>
  
  <p>I'm having a hard time understanding when this function should be called and when it shouldn't. In theory, if the contents of the buffer are going to be overwritten it makes absolutely no difference if the previous contents were trashed or not. Does this mean that a buffer should be called before every write? Or only in certain situations?</p>