title: Memory data flow for uniform variables?
body: <p>When a texture (2D) is supplied to a shader as a 'uniform' input, it is first uploaded to OpenGL using glTexImage2D() and then using glUniform1i() it is associated to shader uniform.</p>
  
  <p>eg code :</p>
  
  <p><strong>Texture data</strong></p>
  
  <p><code>glTexImage2D()</code>: is used to transfer texture data to the server side.</p>
  
  <p><code>glGetUniformLocation()</code>: is used to access shader uniform handle.</p>
  
  <p><code>glUniform1i()</code>: associates the data pointed by texture unit to the shader 'uniform' input.</p>
  
  <p>but when we pass matrix (eg matrix4x4) to a shader as a 'uniform' input, when don't use any specific function to upload it to OpenGL. We just used glUniform..() to associate the data with the shader input which we also used in the case of associating texture data that is already present in OpenGL memory.</p>
  
  <p><strong>Matrix data</strong></p>
  
  <p><code>glGetUniformLocation()</code>: to access shader uniform handle</p>
  
  <p><code>glUniformMatrix4fv()</code>: to associate matrix data to the shader uniform input.</p>
  
  <p><strong>Where does the matrix data live in each step in the process of passing it to a shader as a uniform input?</strong></p>
  
  <ul>
  <li><p>Does matrix data always live on client side/ CPU accessible memory and fetched every frame by server side?</p></li>
  <li><p>If it is uploaded to OpenGL:</p>
  
  <ul>
  <li><p>which step/function call uploads the data?</p></li>
  <li><p>where does the data live in OpenGL memory?</p></li>
  <li><p>how its memory location is pointed?</p></li>
  </ul></li>
  </ul>