title: Is glBufferData actually allocating the memory based on the size on spot?
body: <p>I was wondering, if I use <code>glBufferData</code>, will it allocate the memory exactly when I call it(aka if the size parameter is more than the available memory at that point it will crash) or does it have some kind of special just in time rule that allocates the memory only when I actually copy the data to the buffer?</p>
  
  <p>To make it more concise, my question would be answered by answering an more practical question:</p>
  
  <p>How much memory on the GPU will this take: </p>
  
  <pre><code>glBufferData(GL_ARRAY_BUFFER, 1000, NULL, GL_DYNAMIC_DRAW);
  </code></pre>
  
  <p>And then, how will the occupied memory change when you do this on the same buffer:</p>
  
  <pre><code>glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(poly), &amp;poly);  
  </code></pre>