title: Why rendering engines subdivide an image in small squares?
body: <p>Imagine that I have an image in memory that is represented by an <code>array</code> or an <code>std::vector</code>; for the sake of this example I'm also assuming that my image is like 400x300 pixels and I want to subdivide this structure in squares ( or tiles ) that are 64x64 pixels maximum.</p>
  
  <p>The array that I'm considering is declared like this</p>
  
  <pre><code>int a[400*300];
  </code></pre>
  
  <p>and <strong>not</strong> like</p>
  
  <pre><code>int a[400][300];
  </code></pre>
  
  <p>It's 1 nice contiguous chunk of memory.</p>
  
  <p>My point is that you always try to keep the data structure and the access to that data structure as much as linear as possible . Subdividing the image in squares involves jumping from 1 row to another or from 1 column to another depending on how the image is laid out in memory. I have no problem in computing the boundaries for the squares given a size and the dimensions of the image, but things get a little bit too complicated when expressing the iteration over this squares, without me seeing any real benefit in having this approach.</p>
  
  <p>So why the solution about this kind of subdivision steps is so popular ? why not just render like 1 row at time or 1 column at time ?</p>